Menu

Fwd: PMD Ruleset Editor

Developers
Steve
2015-05-28
2015-05-31
  • Steve

    Steve - 2015-05-28

    Hello,

    I'm new to the mailing list, so please excuse me if I email the wrong
    list or do something unintentional.

    I have been using PMD for a while, and there is something I would like
    to (potentially) create and contribute back to the community.

    We have an XPATH editor for rules which has helped me a lot over the
    last year or so. From this, I am able to create my own rules and put
    them into an XML document myself.

    However, what I would really like, is a "Ruleset editor". By this,
    what I mean, is to be able to see a list of rules, perhaps broken down
    by rulesets they already exist in, and to be able to simply tick the
    ones I want, or add a new one, then export this xml document.

    I am in a situation where the rulesets I need to use are edited fairly
    often, so this would be greatly useful. Currently, I have to go in,
    find xml elements from various places and hodge-podge them together in
    a text editor (notepad++ for me) - you can imagine, I often make
    mistakes doing this.

    Mainly, my reason for asking here is to answer these questions:

    1- Does anyone else have interest in this and would it be useful to
    other users of PMD?

    2- Does this already exist in some dark corner of the internet that I
    do not know about?

    3- For selecting from existing rules, would you prefer to have one
    global "monster.xml" which contains one instance of each rule, or
    would you prefer it to take in a directory to scan for rulesets, and
    grab the rules (removing duplicates) from those rulesets? Personally,
    I think the latter is more maintainable since it means we don't need
    to maintain this "monster.xml".

    4- If all of the above sounds reasonable, I'll set to creating it, I
    will develop it in java, since running PMD requires java anyway I
    don't see that as an issue.

    5- How exactly do I go about contributing this back to PMD and making
    it available for everyone else? Currently, extra things like the
    designer are inside pmd.jar (including the rulesets). I was
    considering developing this as a separate runnable .jar as I was going
    to depend on javafx , would this be an issue for anyone?

    Thanks,
    Steve

     
  • Brian R

    Brian R - 2015-05-28

    Hi Steve,

    The current Eclipse plugin does something similar to what you're describing. You can go into the rule preferences page, select the rules you want, and then export them to xml ruleset file you specify.

    Having the same functionality as a separate, IDE-independent tool would be nice as well.

    Brian

     
    • Steve

      Steve - 2015-05-28

      Hi Brian,

      Thank you for this, I wasn't aware that this already existed, even if it has a requirement to be used within eclipse. I will still create this separately and hope for it to be pulled into PMD-core under the net.sourceforge.pmd.util package as this is where the designer is (I'll name it ruleseteditor), although I won't do it quite as urgently as I was going to.

      I'll update back in a few weeks, hopefully when it's ready for a pull request.

      Steve

       

Log in to post a comment.