Skip to content

Document how to write custom Refaster rules #640

@mikybars

Description

@mikybars

Problem

I couldn't find any documentation on how to write and apply your own Refaster rules. I've tried adding and enabling your Refaster rule compiler to the build like this:

dependencies {
    annotationProcessor("tech.picnic.error-prone-support:refaster-compiler:$errorProneSupportVersion")
    // ...
}
tasks.withType<JavaCompile>().configureEach {
    options.compilerArgs.add("-Xplugin:RefasterRuleCompiler")
    // ...
}

Then I get my regular Java classes with @BeforeTemplate and @AfterTemplate compiled into .refaster files inside build/classes.

Unfortunately, even though I have the Refaster runner dependency as well, I cannot see any of my custom rules kicking in. I get all the error-prone-support checks tough.

Am I missing something here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions