Skip to content

Commit 4abba5c

Browse files
authored
Update README.md
1 parent a756c33 commit 4abba5c

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

README.md

+29-3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@ The linter/type checker can be one or more of `flake8`, `pylint`, `ruff`, `mypy`
4141

4242
### Action
4343

44+
#### Configure the linters
45+
46+
Configure the linters using a configuration file in your repository, appropriate to the linter.
47+
48+
Many can use `pyproject.toml`, but not all.
49+
50+
Example `pyproject.toml` and `.flake8` files for linting this repository are included.
51+
52+
#### Call the Action with a workflow
53+
4454
```yaml
4555
use: advanced-security/python-lint-code-scanning-action@v1
4656
with:
@@ -94,11 +104,21 @@ jobs:
94104
linter: flake8
95105
```
96106
97-
Configure the linters using a configuration file in your repository, appropriate to the linter.
107+
Pin the version of a linter, e.g. if the latest version is incompatible with this Action.
98108
99-
Many can use `pyproject.toml`, but not all.
109+
> ℹ️ Remember to put quotes around version strings so they are not interpreted as floating point numbers.
100110
101-
Example `pyproject.toml` and `.flake8` files for linting this repository are included.
111+
```yaml
112+
jobs:
113+
lint:
114+
runs-on: ubuntu-latest
115+
steps:
116+
- run: python3 -mpip install flake8-bugbear
117+
- use: advanced-security/python-lint-code-scanning-action@v1
118+
with:
119+
linter: ruff
120+
ruff-version: "0.0.257"
121+
```
102122
103123
## FAQ
104124
@@ -140,6 +160,12 @@ We could use Python multi-processing to run them all in parallel, but that doesn
140160

141161
If you want to run them all at once you can call the underlying script with multiple linters, but that feature is really just to make testing easier, since they run in series.
142162

163+
### Why do I see an error, but the run is not marked as having failed?
164+
165+
This avoids errors with a single linter resulting in the whole run being marked as "in error". It is the Code Scanning results that are of interest, not whether every linter ran successfully.
166+
167+
You should check for errors in the Actions log and resolve them. It might be better to have an option to report failure if a linter does not run properly - raise an issue or a PR if you want that.
168+
143169
## License
144170

145171
This project is licensed under the terms of the MIT open source license. Please refer to the [LICENSE](LICENSE) for the full terms.

0 commit comments

Comments
 (0)