Styler is an automatic repair tool to fix formatting errors raised by Checkstyle, a highly configurable formatting-checker for Java. Styler learns fixes for formatting errors and predicts repairs for new errors using machine learning.
Reference: Styler: Learning Formatting Conventions to Repair Checkstyle Violations (Benjamin Loriot, Fernanda Madeiral, Martin Monperrus), Empirical Software Engineering, 2022, DOI:10.1007/s10664-021-10107-0.
Don't forget to clone the submodules :
git clone --recursive [repo]
or after clonning :
git submodule init
git submodule update
For exemple
...
static class RootModule {
final A a;
RootModule(A a) {
this.a = a;
}
@Provides A provideA() { return a; } // <Checkstyle error : "'{' at column 28 should have line break after.">
}
...
...
static class RootModule {
final A a;
RootModule(A a) {
this.a = a;
}
@Provides A provideA() {
return a;
}
}
...
This repository is organized as follows:
- python contains the source of Styler and a guide for it's usage.
- datasets contains all the datasets used for the experiments in the paper.
- jars contains the jars of Codebuff, Naturalize and Checkstyle used during the experiments.
- results contains some results of the experiments conducted on Styler.
Each directory contains its own Readme explaining its own internal organization.
This repository is under the MIT license.