Skip to content

Commit fb59ec3

Browse files
authored
Update README.md
1 parent fd056b6 commit fb59ec3

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,21 @@ In your `.github/workflows/main.yml`, set environment variable `PYLINT_THRESHOLD
2222
You can drop the `env:` section in your `main.yml` file if you want to use the default value `9`.
2323

2424
Set `BLACK_LINE_MAXLEN` to the desired max line length.
25+
26+
In your local repo, it may be useful to add a `validation.sh` script to allow local testing before the GitHub action is run on the server. The following is an example used in a GitHub codespace (where `./venv/` stores the virtual environment):
27+
28+
#!/bin/sh -e
29+
30+
pip install black mypy pylint-fail-under reorder-python-imports safety
31+
pip install -r requirements.txt
32+
33+
export PYLINT_THRESHOLD=8
34+
export BLACK_LINE_MAXLEN=100
35+
36+
black -S -l $BLACK_LINE_MAXLEN --check .
37+
find . -name "*.py" -not -path "./.venv/*" | xargs mypy
38+
find . -name "*.py" -not -path "./.venv/*" | xargs pylint-fail-under --fail_under $PYLINT_THRESHOLD
39+
find . -name "*.py" -not -path "./.venv/*" | xargs reorder-python-imports --diff-only
40+
cat requirements.txt | safety check --stdin
41+
42+
Note that this should match `entrypoint.sh` but you are free to ignore local folders (such as `./.venv/`) if they exist in your dev environment.

0 commit comments

Comments
 (0)