Class Ignored

java.lang.Object
com.qulice.spi.Ignored

public final class Ignored extends Object
A file Qulice leaves alone, wherever the project keeps it.

Three directories of a Maven project hold Java files that are not sources of the product, and Checkstyle, PMD and ErrorProne have nothing useful to say about any of them:

  • src/test/resources holds fixtures: inputs to the tests, which Maven never compiles and which quite often are broken on purpose, because that is exactly what the test needs them to be;
  • src/site holds the sources of the Maven site, where a .java file is an illustration in the documentation rather than code that ships;
  • src/it holds whole projects of their own, the ones maven-invoker-plugin builds, each with its own POM and its own idea of what good code looks like.

All three are skipped by default, without the project having to say so through an <exclude> of its own.

The path handed to the constructor is the one Relative makes: forward slashes, relative to the base directory of the project and starting with a slash, or absolute when the file lies outside of it. Both forms are recognised, and so is a file of a nested Maven module, whose own src/site the path merely contains. The trailing slash of each directory is part of the match, so a src/itest of someone else's making stays in.

Since:
1.0
  • Constructor Details

    • Ignored

      public Ignored(String file)
      Ctor.
      Parameters:
      file - Path of the file, the way Relative makes it
  • Method Details

    • yes

      public boolean yes()
      Is this file ignored?
      Returns:
      TRUE if the file is inside one of the ignored directories