Two errors in developer guide "Autofixes"
Closed this issue · 0 comments
mtnygard commented
Existing text
Add the autofix goal to your goalset
If you already have an Autofix goal, register your new autofix on it:
autofixGoal.with(AddApacheLicenseFileAutofix);
If not, get one. First you instantiate the goal itself and add the AutofixRegistration to it.
const autofixGoal = new Autofix().with(AddApacheLicenseFileAutofix);
Then you add the goal to your goal set. For example, if you want to add the goal to each push, you add the following piece of code.
sdm.addPushRules(onAnyPush().setGoals(autofix));
Problem: addPushRules not found on sdm Object
It appears there is a replacement function withPushRules
.
Problem: Argument name doesn't match declaration above
Line sdm.addPushRules(onAnyPush().setGoals(autofix))
refers to autofix
but the preceding code block uses autofixGoal
.