Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sparksp/elm-review-forbidden-words
An elm-review rule to forbid certain words from comments and README.
https://github.com/sparksp/elm-review-forbidden-words
elm elm-review
Last synced: 8 days ago
JSON representation
An elm-review rule to forbid certain words from comments and README.
- Host: GitHub
- URL: https://github.com/sparksp/elm-review-forbidden-words
- Owner: sparksp
- License: mit
- Created: 2020-05-24T12:59:09.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-08-11T06:41:08.000Z (3 months ago)
- Last Synced: 2024-08-11T07:40:30.888Z (3 months ago)
- Topics: elm, elm-review
- Language: Elm
- Homepage: https://package.elm-lang.org/packages/sparksp/elm-review-forbidden-words/latest/
- Size: 1.12 MB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# elm-review-forbidden-words
![elm package](https://img.shields.io/elm-package/v/sparksp/elm-review-forbidden-words)
![elm-review 2.3](https://img.shields.io/badge/elm--review-2.3-%231293D8)
![elm 0.19](https://img.shields.io/badge/elm-0.19-%231293D8)
![Tests](https://github.com/sparksp/elm-review-forbidden-words/workflows/Tests/badge.svg)Provides an [`elm-review`](https://package.elm-lang.org/packages/jfmengels/elm-review/latest/) rule to forbid certain words in Elm comments, README and elm.json.
## Example configuration
```elm
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".
## Failure Examples
Based on the configured words `"TODO"` and `"- [ ]"` the following examples would fail:
```elm
-- TODO: Finish writing this function
^^^^
-- [ ] Documentation
^^^^^
``````elm
{- Actions
- [ ] Documentation
^^^^^
- [ ] Tests
^^^^^
-}
``````json
{
"summary": "TODO write a summary",
^^^^
}
```## Ignore README.md
You can easily ignore forbidden words in the README file like this:
```elm
import NoForbiddenWords
import Review.Rule exposing (Rule)config : List Rule
config =
[ NoForbiddenWords.rule [ "TODO", "- [ ]" ]
|> Rule.ignoreErrorsForFiles [ "README.md" ]
]
```## Try it out
You can try the example configuration above out by running the following command:
```bash
elm-review --template sparksp/elm-review-forbidden-words/example
```