Git Product home page Git Product logo

Comments (4)

fallard avatar fallard commented on June 17, 2024

You can also do that in your ruleset file so it can be used by any tools, not just Eclipse (ex. maven) :

<ruleset>
  <description>MyPMDConfig</description>
  <exclude-pattern>.*target/.*</exclude-pattern>
  <exclude-pattern>.*src/main/webapp/.*</exclude-pattern>
...
</ruleset>

from eclipse-pmd.

ffeisst avatar ffeisst commented on June 17, 2024

Yes I know, however I have a ruleset file referenced via URL which is used by multiple projects (and therefore no exclude pattern are defined in this ruleset). If I configure a second, project local, ruleset file with exclude pattern, they are not applied to the rules from the remote ruleset.

from eclipse-pmd.

fallard avatar fallard commented on June 17, 2024

I see your point, but if you use maven, the rules will be applied and the checks and reports will contains validations on your generated sources.

Also, I think it is not a bad idea to put this exclude pattern in your remote ruleset. It seems to me that I would like to apply this exclude to any of my projects having generated sources...

That said, I'm not the eclipse-pmd developer, only a user ;)

from eclipse-pmd.

acanda avatar acanda commented on June 17, 2024

One of the main goals of eclipse-pmd is to make it easy to let a development team work with the same PMD rule set so a developer can fix the code issues right away and there won't be any PMD violations any more when the code is committed and pushed to the build server. Allowing to define exclusion patterns outside the PMD rule set file would work against this goal. Therefore I won't add exclusion patterns to the .eclipse-pmd file.

However, your problem is a special case: you do not want to check your generated code. This is understandable and eclipse-pmd already supports this. Usually a source folder containing generated code has the "derived" flag set by the generator that creates the code. eclipse-pmd already checks this flag and analyses the code only if it is not set. It seems like your generator did not set this flag. The flag can be set manually by ticking the respective check box in the properties of the folder.

derived

You have to disable and enable eclipse-pmd after setting the flag as it does not seem to automatically pick up the change.

Let me know if that solves your problem.

from eclipse-pmd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.