Giter VIP home page Giter VIP logo

Comments (3)

xvik avatar xvik commented on June 26, 2024

Good case! This is a quality plugin issue.

The root problem is that new spotbugs plugin use gradle properties instead of direct fields, which force me to do many hacks to init them early because otherwise values simply ignored (read property can't be updated and gradle read task properties too early). As a result:

  • exclusion config is always forcefully substituted (because I can't read property to look if there already custom value - properly would be locked)
  • exclusion logic applied too early (because spotbugs task property gets evaluated too early) and no actual exclusions get registered (files not yet generated)

The only workaround for you now is to modify default exclusions file:

  1. Init configs with: gradlew initQualityConfig
  2. Remove everything in gradle/config except spotbugs/exclude.xml (default files will be used implicitly)
  3. Add your manual exclusion to exclude.xml file
<Match>
    <Source name="~.*?MapperImpl.*" />
</Match>

After that, you can remove all additional configurations in build.gradle

Issues list (to not forget):

  • Fix "afterEvaluation" in docs
  • Document the correct way of default config files override
  • Document why manually set spotbugs.excludeFilter will not work (try to support it?)
  • Fix spotbugs exclusions for generated sources (correct lifecycle) for both "exclude" and "excludeSources"

from gradle-quality-plugin.

eekboom avatar eekboom commented on June 26, 2024

Thanks a lot for the quick reply! That workaround is fine for us.
It really would be nice if files in the default paths for generated source would be ignored.
I couldn't make that work with the spotbugs exclusions, though, because the name seems to not include the directory path. ("~.*?/generated/sources/.*" does not work.)

from gradle-quality-plugin.

xvik avatar xvik commented on June 26, 2024

quality.excludeSources is the only option for filtering by source location. All other exclusions are relative to source root. Someday it will work again (but not very soon - maybe a few weeks).

If possible, try to generate sources into a special package to be able to exclude an entire package with standard spotbugs exclusions file.

from gradle-quality-plugin.

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.