Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/grantmcconnaughey/Flake8Rules
Descriptions and examples for the rules in Flake8 (pyflakes, pycodestyle, and mccabe).
https://github.com/grantmcconnaughey/Flake8Rules
flake8 mccabe pycodestyle pyflakes python
Last synced: about 1 month ago
JSON representation
Descriptions and examples for the rules in Flake8 (pyflakes, pycodestyle, and mccabe).
- Host: GitHub
- URL: https://github.com/grantmcconnaughey/Flake8Rules
- Owner: grantmcconnaughey
- License: mit
- Created: 2017-11-27T03:58:58.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-11-24T10:09:30.000Z (about 1 year ago)
- Last Synced: 2024-08-03T20:11:43.087Z (5 months ago)
- Topics: flake8, mccabe, pycodestyle, pyflakes, python
- Language: HTML
- Homepage: https://www.flake8rules.com
- Size: 131 KB
- Stars: 240
- Watchers: 5
- Forks: 36
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Flake8 Rules
Documentation and examples for the rules in [Flake8](http://flake8.pycqa.org/en/latest/index.html) ([pyflakes](https://github.com/PyCQA/pyflakes), [pycodestyle](http://pycodestyle.pycqa.org/en/latest/), and [mccabe](https://github.com/pycqa/mccabe)).
## API
Flake8 Rules includes simple API with two endpoints.
### Retrieve a single rule
This endpoints returns a single Flake8 rule.
**Heads up:** This endpoint returns JSON content but the Content-Type is set to `text/html`. This is due to Jekyll's inability to generate files with permalinks that end in `.json`.
```
$ curl https://www.flake8rules.com/api/rules/E111/
{
"code": "E111",
"message": "Indentation is not a multiple of four",
"content": "The rendered HTML content",
"links": ["https://www.python.org/dev/peps/pep-0008/#indentation"]
}
```* `code` - The 4 character Flake8 issue code.
* `message` - A short message describing the issue.
* `content` - The fully rendered HTML content describing the issue and how to fix it.
* `links` - A list of additional links to visit for more information.### Retrieve a list of all rules
This endpoint returns a list of all Flake8 rules.
```
$ curl https://www.flake8rules.com/api/rules.json
[
{
"code": "F812",
"message": "List comprehension redefines name from line n",
"content": "The rendered HTML content",
"links": ["https://docs.python.org/2/tutorial/datastructures.html#list-comprehensions"]
}
]
```## Contributing
All rules go in the `_rules` directory. They should be named with their 4 character code, like `E301.md`.
To run the jekyll development server first [install Jekyll](https://jekyllrb.com/docs/installation/). Then run the following:
```
$ bundle exec jekyll serve
```### Documenting Errors
* pyflakes error codes: http://flake8.pycqa.org/en/latest/user/error-codes.html#error-violation-codes
* pycodestyle error codes: http://pycodestyle.pycqa.org/en/latest/intro.html#error-codesExamples of pycodestyle error violations can be found in the project's [test suite](https://github.com/PyCQA/pycodestyle/tree/master/testsuite). This is useful for understanding violations and documenting them.