elimohl / Flake8Rules

Descriptions and examples for the rules in Flake8 (pyflakes, pycodestyle, and mccabe).

Home Page:https://lintlyci.github.io/Flake8Rules/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flake8 Rules

Documentation and examples for the rules in Flake8 (pyflakes, pycodestyle, and 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://lintlyci.github.io/Flake8Rules/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://lintlyci.github.io/Flake8Rules/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. Then run the following:

$ bundle exec jekyll serve

About

Descriptions and examples for the rules in Flake8 (pyflakes, pycodestyle, and mccabe).

https://lintlyci.github.io/Flake8Rules/

License:MIT License


Languages

Language:CSS 53.3%Language:HTML 36.7%Language:Ruby 10.0%