Set up code linting tools
- use flake8 as the main linting tool with the following plug-ins: + flake8-annotations + flake8-bandit + flake8-black + flake8-broken-line + flake8-bugbear + flake8-commas + flake8-comprehensions + flake8-debugger + flake8-docstrings + flake8-eradicate + flake8-isort + flake8-quotes + flake8-string-format + flake8-pyproject + pep8-naming + pydoclint - use mypy for static type checking - use ruff for linting for future compatibility - add nox session "lint" to run these tools - add `ruff check --fix ...` in nox session "format" - lint all source files => no errors found
This commit is contained in:
parent
fb407631d9
commit
ecf1420742
4 changed files with 899 additions and 8 deletions
20
README.md
20
README.md
|
|
@ -9,6 +9,8 @@ The goal of the `lalib` project is to create
|
|||
|
||||
|
||||
[](https://github.com/psf/black)
|
||||
[](https://mypy-lang.org/)
|
||||
[](https://github.com/astral-sh/ruff)
|
||||
|
||||
|
||||
## Contributing & Development
|
||||
|
|
@ -68,20 +70,28 @@ To execute all default tasks, simply invoke:
|
|||
`nox`
|
||||
|
||||
|
||||
#### Code Formatting
|
||||
#### Code Formatting & Linting
|
||||
|
||||
We follow [Google's Python style guide](https://google.github.io/styleguide/pyguide.html).
|
||||
We follow [Google's Python style guide](https://google.github.io/styleguide/pyguide.html)
|
||||
and include [type hints](https://docs.python.org/3/library/typing.html)
|
||||
where possible.
|
||||
|
||||
During development,
|
||||
`nox -s format` may be helpful.
|
||||
It can be speed up by re-using a previously created environment
|
||||
`nox -s format` and `nox -s lint` may be helpful.
|
||||
Both can be speed up by re-using a previously created environment
|
||||
with the `-R` flag.
|
||||
|
||||
This task formats all source code files with
|
||||
The first task formats all source code files with
|
||||
[autoflake](https://pypi.org/project/autoflake/),
|
||||
[black](https://pypi.org/project/black/), and
|
||||
[isort](https://pypi.org/project/isort/).
|
||||
|
||||
The second task lints all source code files with
|
||||
[flake8](https://pypi.org/project/flake8/),
|
||||
[mypy](https://pypi.org/project/mypy/), and
|
||||
[ruff](https://pypi.org/project/ruff/).
|
||||
`flake8` is configured with a couple of plug-ins.
|
||||
|
||||
|
||||
### Branching Strategy
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue