Skip to content

Disable refactor rules #1569

@martinaldrin

Description

@martinaldrin

Describe the bug

I'm trying to enable error-prone with the refactor rules in our projects.
The problem that I facing is that I can't disable rules like PreconditionsRules
https://error-prone.picnic.tech/refasterrules/PreconditionsRules/#checkargument

  • [ No] I have verified that the issue is reproducible against the latest version
    of the project.
    I was not able to use 2.36.0, so I use 2.35.1 due to other issues.
  • [yes ] I have searched through existing issues to verify that this issue is not
    already known.
    I have tried to find information about how to enable/disable refactor rules and I can not get name pattern working.

Minimal Reproducible Example

<properties>
    <error-prone.version>2.35.1</error-prone.version>
    <error-prone-support.version>0.20.0</error-prone-support.version>
    <error-prone.configuration-args>-Xep:AmbiguousJsonCreator:ERROR -Xep:AssertJIsNull:ERROR -Xep:AutowiredConstructor:ERROR -Xep:CanonicalAnnotationSyntax:ERROR -Xep:CollectorMutability:ERROR -Xep:DirectReturn:ERROR -Xep:EmptyMethod:ERROR -Xep:ExplicitEnumOrdering:ERROR -Xep:FormatStringConcatenation:ERROR -Xep:ImmutablesSortedSetComparator:ERROR -Xep:IsInstanceLambdaUsage:ERROR -Xep:MockitoMockClassReference:ERROR -Xep:MockitoStubbing:ERROR -Xep:NestedOptionals:ERROR -Xep:PrimitiveComparison:ERROR -Xep:RedundantStringConversion:ERROR -Xep:Slf4jLogStatement:ERROR -Xep:StringJoin:ERROR -Xep:TimeZoneUsage:ERROR -Xep:JUnitClassModifiers:OFF -Xep:JUnitMethodDeclaration:OFF -Xep:JUnitValueSource:OFF -Xep:LexicographicalAnnotationListing:OFF -Xep:StaticImport:OFF -Xep:ArrayToString:OFF -Xep:FormatString:OFF</error-prone.configuration-args>
    <error-prone.refactor-args>-XepPatchChecks:Refaster -XepPatchLocation:IN_PLACE -XepOpt:Refaster:NamePattern=^(?!PreconditionsRules\$).*</error-prone.refactor-args>
</properties>
org.apache.maven.plugins maven-compiler-plugin false true ${compiler.source.java.version} ${compiler.target.java.version} ${compiler.release.java.version} UTF-8 false -Xpkginfo:always -XDcompilePolicy=simple -Xplugin:ErrorProne ${error-prone.configuration-args} ${error-prone.refactor-args} -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.source.tree=ALL-UNNAMED -J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED -J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED com.google.errorprone error_prone_core ${error-prone.version} tech.picnic.error-prone-support error-prone-contrib ${error-prone-support.version} tech.picnic.error-prone-support refaster-runner ${error-prone-support.version}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions