Skip to content

Commit 0b65a6c

Browse files
committed
move safety check to pre-commit
1 parent 4c72313 commit 0b65a6c

File tree

6 files changed

+5
-21
lines changed

6 files changed

+5
-21
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ jobs:
4646
- run: invoke integration.version
4747
- run: invoke integration.initialize
4848
- run: invoke unit.pytest
49-
- run: invoke test.security
5049
- run: invoke integration.query
5150
- run: invoke integration.write-policy
5251
- run: invoke build.uninstall-package

.github/workflows/publish.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ jobs:
2929
- run: invoke integration.version
3030
- run: invoke integration.initialize
3131
- run: invoke unit.pytest
32-
- run: invoke test.security
3332
- run: invoke integration.query
3433
- run: invoke integration.write-policy
3534
- run: invoke build.uninstall-package

.github/workflows/update.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ jobs:
6363
- run: invoke integration.version
6464
- run: invoke integration.initialize
6565
- run: invoke unit.pytest
66-
# - run: invoke test.lint
67-
- run: invoke test.security
6866
- run: invoke integration.query
6967
- run: invoke integration.write-policy
7068
- run: invoke build.uninstall-package

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,8 @@ repos:
1616
files: ^policy_sentry/
1717
- id: ruff-format
1818
files: ^policy_sentry/
19+
- repo: https://github.com/Lucas-C/pre-commit-hooks-safety
20+
rev: v1.3.3
21+
hooks:
22+
- id: python-safety-dependencies-check
23+
files: ^requirements.txt

requirements-dev.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ pytest==8.2.2
55
coverage==7.6.0
66
# Integration tests and tasks
77
invoke==2.2.0
8-
# Security testing
9-
safety==3.2.4
108
# Type hints
119
mypy==1.10.1
1210
types-pyyaml==6.0.12.20240311

tasks.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -269,20 +269,6 @@ def query_with_yaml(c):
269269
sys.exit(1)
270270

271271

272-
# TEST - SECURITY
273-
@task
274-
def security_scan(c):
275-
"""Runs `safety check`"""
276-
try:
277-
c.run("safety check")
278-
except UnexpectedExit as u_e:
279-
logger.critical(f"FAIL! UnexpectedExit: {u_e}")
280-
sys.exit(1)
281-
except Failure as f_e:
282-
logger.critical(f"FAIL: Failure: {f_e}")
283-
sys.exit(1)
284-
285-
286272
# TEST - type check
287273
@task
288274
def run_mypy(c):
@@ -336,7 +322,6 @@ def build_docker(c):
336322

337323
# test.add_task(run_full_test_suite, 'all')
338324
test.add_task(run_mypy, "type-check")
339-
test.add_task(security_scan, "security")
340325

341326
build.add_task(build_package, "build-package")
342327
build.add_task(install_package, "install-package")

0 commit comments

Comments
 (0)