Skip to content

Commit 695b35b

Browse files
committed
add clarifications
1 parent ae22208 commit 695b35b

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

article/article.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ Here are the linters and checks we are going to use:
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

3131
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
32-
a [repo](https://github.com/iamtodor/github-actions-python-configuration-demo/blob/main/pyproject.toml).
33-
32+
a [demo repo](https://github.com/iamtodor/github-actions-python-configuration-demo/blob/main/pyproject.toml).
33+
~
3434
![pyproject.toml](https://github.com/iamtodor/github-actions-python-configuration-demo/blob/main/article/img/flakeheaven-pyproject-config.png?raw=true)
3535

3636
I would say the config file is self-explainable, so I will not stop here for a while. Just a few notes about tiny tweaks.
@@ -79,6 +79,13 @@ dags/dummy.py
7979

8080
So we need to disable `E0401` check from `pylint`.
8181

82+
Another possible solution to disable this check is to include `# noqa: E0401` to import statement.
83+
84+
```python
85+
from airflow import DAG # noqa: E0401
86+
from airflow.operators.dummy_operator import DummyOperator # noqa: E0401
87+
```
88+
8289
![flakeheaven disable import checks](https://github.com/iamtodor/github-actions-python-configuration-demo/blob/main/article/img/flakeheaven-disable-import-checks.png?raw=true)
8390

8491
We assume that the developer who writes the code and imports the libs is responsible for the writing reliable tests. So if the test does not pass it means that it's something with import or a code (logic) itself. Import check is not something we would like to put as a linter job.
@@ -125,13 +132,15 @@ This is about how we specify task order. The workaround here is to exclude `W010
125132

126133
![disable W0104](https://github.com/iamtodor/github-actions-python-configuration-demo/blob/main/article/img/flakeheaven-disable-statement-no-effect-W0104.png?raw=true)
127134

135+
More info about rules could be found on [flake8 rules page](https://www.flake8rules.com/).
136+
128137
## GitHub workflow actions CI/CD configurations
129138

130139
**Disclaimer**: author assumes you are familiar with [GitHub actions](https://github.com/features/actions).
131140

132141
We configure GitHub Workflow to be triggered on every PR against the main (master) branch.
133142

134-
The whole `py_linter.yml` config could be found in a [repo](https://github.com/iamtodor/github-actions-python-demo/blob/main/.github/workflows/py_linter.yml). I will walk you thru it step by step.
143+
The whole `py_linter.yml` config could be found in a [demo repo](https://github.com/iamtodor/github-actions-python-demo/blob/main/.github/workflows/py_linter.yml). I will walk you thru it step by step.
135144

136145
![py_linter.yml](https://github.com/iamtodor/github-actions-python-configuration-demo/blob/main/article/img/gh-config-full.png?raw=true)
137146

0 commit comments

Comments
 (0)