Skip to content

Commit ae22208

Browse files
committed
add clarifications
1 parent 145cc3a commit ae22208

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

article/article.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ This article has two major parts: the first one is linter configuration, and the
1717

1818
## Linters configuration
1919

20-
**Disclaimer**: author assumes you are familiar with the above-mentioned linters, tools, and checks.
21-
2220
Here are the linters and checks we are going to use:
2321

2422
- [flake8](https://flake8.pycqa.org/en/latest/)
2523
- [flakeheaven](https://flakeheaven.readthedocs.io/en/latest/)
2624
- [black](https://github.com/psf/black)
2725
- [isort](https://github.com/PyCQA/isort)
2826

27+
**Disclaimer**: author assumes you are familiar with the above-mentioned linters, tools, and checks.
28+
2929
I would like to share how to configure it for the python project. I prepared a full [github actions python configuration demo repository](https://github.com/iamtodor/github-actions-python-demo).
3030

31-
We use flakeheaven as a flake8 wrapper, which is very easy to configure in one single `pyproject.toml`. The whole `pyproject.toml` configuration file could be found in
31+
We use `flakeheaven` as a `flake8` wrapper, which is very easy to configure in one single `pyproject.toml`. The whole `pyproject.toml` configuration file could be found in
3232
a [repo](https://github.com/iamtodor/github-actions-python-configuration-demo/blob/main/pyproject.toml).
3333

3434
![pyproject.toml](https://github.com/iamtodor/github-actions-python-configuration-demo/blob/main/article/img/flakeheaven-pyproject-config.png?raw=true)
@@ -41,7 +41,23 @@ A few checks that we don't want to see complain about:
4141

4242
#### Documentation
4343

44-
We are ok if not every module will be documented. We are ok if not every function or method will be documented.
44+
Default `flakeheaven` configuration assumes every component is documented.
45+
46+
```
47+
>>> python -m flakeheaven lint utils.py
48+
49+
utils.py
50+
1: 1 C0114 Missing module docstring (missing-module-docstring) [pylint]
51+
def custom_sum(first: int, second: int) -> int:
52+
^
53+
1: 1 C0116 Missing function or method docstring (missing-function-docstring) [pylint]
54+
def custom_sum(first: int, second: int) -> int:
55+
^
56+
5: 1 C0116 Missing function or method docstring (missing-function-docstring) [pylint]
57+
def custom_multiplication(first: int, second: int) -> int:
58+
```
59+
60+
We are ok if not every module will be documented. We are ok if not every function or method will be documented. We are not going to push documentation for documentation's sake. So we want to disable `C0114` and `C0116` checks from pylint.
4561

4662
![flakeheaven disable docs](https://github.com/iamtodor/github-actions-python-configuration-demo/blob/main/article/img/flakeheaven-disable-docs.png?raw=true)
4763

@@ -61,7 +77,7 @@ dags/dummy.py
6177
^
6278
```
6379

64-
So we need to disable this check:
80+
So we need to disable `E0401` check from `pylint`.
6581

6682
![flakeheaven disable import checks](https://github.com/iamtodor/github-actions-python-configuration-demo/blob/main/article/img/flakeheaven-disable-import-checks.png?raw=true)
6783

0 commit comments

Comments
 (0)