facebook/arcanist — pull request #130 by joshuaspence (2013-12-23 02:26:39+00:00)
Title: Allow setting custom spelling data for `ArcanistSpellingLinter`

The `ArcanistSpellingDefaultData` is non-final and can be extended (which is great), however there is no straight-forward way to use custom spelling data with the `ArcanistSpellingLinter`. Currently, something similar to this would need to be done:

```
$linter = id(new ArcanistSpellingLinter());

foreach (CustomSpellingData::getPartialWordRules() as $severity => $rules) {
foreach ($rules as $incorrect_word => $correct_word) {
$linter->addPartialWordRule($incorrect_word, $correct_word, $severity);
}
}

foreach (CustomSpellingData::getFullWordRules() as $severity => $rules) {
foreach ($rules as $incorrect_word => $correct_word) {
$linter->addWholeWordRule($incorrect_word, $correct_word, $severity);
}
}
```

The proposed changes allow a much nicer syntax:

```
$linter = id(new ArcanistSpellingLinter())
->setSpellingData(new CustomSpellingData());
```