Skip to content

Commit 9a86f93

Browse files
committed
fix typos
1 parent e270897 commit 9a86f93

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

article/article.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ Recently I was involved in configuring linters as a part of CI/CD in GitHub acti
99

1010
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).
1111

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

1616
![pyproject.toml](https://github.com/iamtodor/github-actions-python-configuration-demo/blob/main/article/img/flakeheaven-pyproject-config.png?raw=true)
1717

18-
Disclaimer: author assumes you are familiar with above-mentioned linters, tools, and checks. I would say the config file
18+
Disclaimer: author assumes you are familiar with the above-mentioned linters, tools, and checks. I would say the config file
1919
is self-explainable, so I will not stop here for a while. Just a few notes about tiny tweaks.
2020

2121
A few checks that we don't want to see complain about:
@@ -38,7 +38,7 @@ not something we would like to put as a linter job.
3838

3939
### Tweaks for airflow code
4040

41-
In order to configure code for Airflow DAGs there are also a few tweaks. Here is the dummy example `dummy.py`.
41+
To configure code for Airflow DAGs there are also a few tweaks. Here is the dummy example `dummy.py`.
4242

4343
![python dummy DAG](https://github.com/iamtodor/github-actions-python-configuration-demo/blob/main/article/img/python-airflow-tasks-order.png?raw=true)
4444

@@ -59,12 +59,12 @@ dags/dummy.py
5959
^
6060
```
6161

62-
However, we want to keep each task be specified in a new line, hence we need to disable `W503` from pycodestyle: Disable
62+
However, we want to keep each task specified in a new line, hence we need to disable `W503` from pycodestyle: Disable
6363
line break before binary operator.
6464

6565
![disable W503](https://github.com/iamtodor/github-actions-python-configuration-demo/blob/main/artricle/img/diable-line-break.png?raw=true)
6666

67-
Next, with default configuration we would get the next warning:
67+
Next, with the default configuration we would get the next warning:
6868

6969
```
7070
python -m flakeheaven lint .
@@ -84,7 +84,7 @@ specify task order.
8484

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

87-
We configure GitHub Workflow to be triggered on every PR against main (master) branch.
87+
We configure GitHub Workflow to be triggered on every PR against the main (master) branch.
8888

8989
Here are the linters and checks we are going to use:
9090

@@ -102,17 +102,17 @@ We are interested in running linter only when PR has `.py` files. For instance,
102102

103103
![configure run workflow on PRs and push](https://github.com/iamtodor/github-actions-python-configuration-demo/blob/main/article/img/gh-config-py-push-pr.png?raw=true)
104104

105-
We are interested in running a linter only against the modified files. Let's say, we take a look at the provided repo, if I update `dags/dummy.py` I don't want to waste a time and resources running linter against `main.py`. For this purpose we use [Paths Filter GitHub Action](https://github.com/dorny/paths-filter), that is very flexible.
105+
We are interested in running a linter only against the modified files. Let's say, we take a look at the provided repo, if I update `dags/dummy.py` I don't want to waste a time and resources running linter against `main.py`. For this purpose we use [Paths Filter GitHub Action](https://github.com/dorny/paths-filter), which is very flexible.
106106

107107
![Paths Filter GitHub Action](https://github.com/iamtodor/github-actions-python-configuration-demo/blob/main/artricle/img/check-for-python-file-changes.png?raw=true)
108108

109109
If we have in one PR modified `.py` and any other files such as `.toml`, we don't want to run linter against not `.py`, so we use where we configured filtering only for `.py` files no matter its location: root, tests, src, etc.
110110

111-
Changed file can have the following statuses `added`, `modified`, or `deleted`. There is no reason to run a linter against deleted file as your workflow would simply fail, because there is no more that particular changed file in repo. So we need to configure what changes we consider to trigger linter.
111+
The changed file can have the following statuses `added`, `modified`, or `deleted`. There is no reason to run a linter against deleted files as your workflow would simply fail, because there is no more that particular changed file in the repo. So we need to configure what changes we consider to trigger linter.
112112

113113
![added|modified](https://github.com/iamtodor/github-actions-python-configuration-demo/blob/main/artricle/img/added-modified.png?raw=true)
114114

115-
I define the variable where I can find the output (the only `.py` files) from the previous filter. This variable would contain modified `.py` files, that I can further pass to a `flakeheaven`, `black`, and `isort`. By default, the output is disabled, and Paths Changes Filter allows to customize it: you can list the files in `.csv`, `.json` or in a `shell` mode. Linters accept files separated simply by space, so our choice here is `shell` mode.
115+
I define the variable where I can find the output (the only `.py` files) from the previous filter. This variable would contain modified `.py` files, that I can further pass to a `flakeheaven`, `black`, and `isort`. By default, the output is disabled, and Paths Changes Filter allows you to customize it: you can list the files in `.csv`, `.json`, or in a `shell` mode. Linters accept files separated simply by space, so our choice here is `shell` mode.
116116

117117
![list files shell](https://github.com/iamtodor/github-actions-python-configuration-demo/blob/main/article/img/gh-config-list-files-shell.png?raw=true)
118118

@@ -122,7 +122,7 @@ The next and last step is to run the linter itself.
122122

123123
![run linter step](https://github.com/iamtodor/github-actions-python-configuration-demo/blob/main/article/img/gh-run-linter.png?raw=true)
124124

125-
Before we run linter on changed files we run a check if there is an actual changes in `.py` files, if there are any `.py` files from the previous step than we can use.
125+
Before we run linter on changed files we run a check if there is an actual change in `.py` files, if there are any `.py` files from the previous step.
126126

127127
![check if there are .py files](https://github.com/iamtodor/github-actions-python-configuration-demo/blob/main/article/img/gh-config-check-for-changes.png?raw=true)
128128

@@ -132,12 +132,12 @@ Next, using the before-mentioned output variable we can safety pass the content
132132

133133
## Conclusion
134134

135-
That's all I would like to share. I hope it is useful for you, and you can utilize this experience and knowledge.
135+
That's all I would like to share. I hope it is useful for you, and that you can utilize this experience and knowledge.
136136

137-
I wish you to see this success checks every time you push your code :)
137+
I wish you to see these success checks every time you push your code :)
138138

139139
![success linter](https://github.com/iamtodor/github-actions-python-configuration-demo/blob/main/article/img/linter-success.png?raw=true)
140140

141-
If you have any questions feel free to ask in a comment section, I will do my best to provide compherensive answer for you.
141+
If you have any questions feel free to ask in a comment section, I will do my best to provide a comprehensive answer for you.
142142

143-
Question to you: do you have a linter checks as a part of your CI/CD?
143+
Question to you: do you have linter checks as a part of your CI/CD?

0 commit comments

Comments
 (0)