Provides an elm-review
rule to forbid certain words in Elm comments, README and elm.json.
module ReviewConfig exposing (config)
import NoForbiddenWords
import Review.Rule exposing (Rule)
config : List Rule
config =
[ NoForbiddenWords.rule [ "TODO", "- [ ]" ]
]
Note: We search for the exact string that you enter, so if you're looking for "TODO" we won't report "todo".
Based on the configured words "TODO"
and "- [ ]"
the following examples would fail:
-- TODO: Finish writing this function
^^^^
-- [ ] Documentation
^^^^^
{- Actions
- [ ] Documentation
^^^^^
- [ ] Tests
^^^^^
-}
{
"summary": "TODO write a summary",
^^^^
}
You can easily ignore forbidden words in the README file like this:
import NoForbiddenWords
import Review.Rule exposing (Rule)
config : List Rule
config =
[ NoForbiddenWords.rule [ "TODO", "- [ ]" ]
|> Rule.ignoreErrorsForFiles [ "README.md" ]
]
You can try the example configuration above out by running the following command:
elm-review --template sparksp/elm-review-forbidden-words/example