atomisthq / docs

End-user documentation sources and generator
https://docs.atomist.com
GNU General Public License v3.0
7 stars 28 forks source link

Two errors in developer guide "Autofixes" #278

Closed mtnygard closed 5 years ago

mtnygard commented 5 years ago

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.