File tree 5 files changed +514
-363
lines changed
5 files changed +514
-363
lines changed Original file line number Diff line number Diff line change 92
92
- name : Black
93
93
if : always()
94
94
run : poetry run black --check --diff .
95
- - name : Safety
96
- if : always()
97
- run : poetry run safety check
95
+ - name : Pip-Audit
96
+ if : ${{ matrix.os == 'ubuntu-22.04' }}
97
+ run :
98
+ bash -c "poetry run pip-audit --progress-spinner=off --strict -r
99
+ <(poetry export -f requirements.txt --with dev | sed 's/\[.*\]//g' |
100
+ sed -z 's/\n\W//g' | uniq )"
98
101
- name : Pytest
99
102
run : poetry run pytest -vv -m "not skip_on_gh" --cov --cov-report=xml
100
103
- name : Coverage
Original file line number Diff line number Diff line change @@ -31,12 +31,17 @@ repos:
31
31
entry : poetry run black src/normcap src/tests/ package/
32
32
types : [python]
33
33
34
- - id : safety
35
- name : safety
34
+ - id : pip-audit
35
+ name : pip-audit
36
36
stages : [commit]
37
37
language : system
38
- entry : poetry run safety check
39
- types : [python]
38
+ entry :
39
+ bash -c "poetry run pip-audit --strict -r <(poetry export -f
40
+ requirements.txt --with dev | sed 's/\[.*\]//g' | sed -z 's/\n\W//g' |
41
+ uniq )"
42
+ # First `sed` removes potential "[<extra>]" after package names
43
+ # Second `sed` removes "\n" in front of "--hash" to get one line per package
44
+ # Final `uniq` is the used to de-duplicated those lines
40
45
pass_filenames : false
41
46
42
47
- id : ruff
Original file line number Diff line number Diff line change @@ -204,7 +204,7 @@ def patch_file(
204
204
205
205
Indents the patch like the line after which it is inserted.
206
206
"""
207
- patch_hash = hashlib .md5 (patch .encode ()).hexdigest ()
207
+ patch_hash = hashlib .md5 (patch .encode ()).hexdigest () # noqa: S324
208
208
209
209
with open (file_path , encoding = "utf8" ) as f :
210
210
if f .read ().find (patch_hash ) > - 1 :
You can’t perform that action at this time.
0 commit comments