Class ExcludeTestPackages

  • All Implemented Interfaces:
    com.puppycrawl.tools.checkstyle.api.Filter

    public class ExcludeTestPackages
    extends Object
    implements com.puppycrawl.tools.checkstyle.api.Filter
    Allows disabling some rules for the test suite source. Any violation will be suppressed if it's generated by a source file having /src/test/java included in its path and if the violation message contains the keyword "[not required for tests]".

    A SuppressionFilter is too generic, and requires per-module configuration.

    Author:
    Sanne Grinovero
    • Constructor Detail

      • ExcludeTestPackages

        public ExcludeTestPackages()
    • Method Detail

      • accept

        public boolean accept​(com.puppycrawl.tools.checkstyle.api.AuditEvent aEvent)
        Specified by:
        accept in interface com.puppycrawl.tools.checkstyle.api.Filter
      • acceptTestfileEvent

        private boolean acceptTestfileEvent​(com.puppycrawl.tools.checkstyle.api.AuditEvent aEvent)