Skip to content

Commit 0572b26

Browse files
semgrep
1 parent 76b8440 commit 0572b26

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

.github/workflows/test.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ env:
88
PYTHON_VERSION: "3.13"
99

1010
jobs:
11-
lint_black_formatting:
11+
black_formatting:
1212
name: Black Format Linting
1313
runs-on: ubuntu-latest
1414
steps:
@@ -39,6 +39,20 @@ jobs:
3939
run: |
4040
nox -s pytest-${{ matrix.python-version }}
4141
42+
semgrep_src:
43+
name: Semgrep security scanning
44+
runs-on: ubuntu-latest
45+
steps:
46+
- name: Checkout code
47+
uses: actions/checkout@v4
48+
- name: Prepare common Python build environment
49+
uses: ./.github/actions/python-common-setup
50+
with:
51+
python-version: ${{ env.PYTHON_VERSION }}
52+
- name: 'Nox: Semgrep - src'
53+
run: |
54+
nox -s semgrep_src
55+
4256
mypy_all:
4357
name: MyPy - All
4458
runs-on: ubuntu-latest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ mypy.xml
1111
pip-wheel-metadata
1212
pytest.xml
1313
pytest-*.xml
14+
semgrep-*.xml
1415
site
1516
*.venv
1617
venv*

noxfile.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ def pytest(session):
2020
session.run("pytest", "-v", *options)
2121

2222

23+
@nox.session(python=_DEFAULT_PYTHON)
24+
def semgrep_src(session):
25+
session.install("-e", ".[tests]")
26+
# session.run("semgrep", "scan", "--strict", "--verbose", "--junit-xml", "--junit-xml-output=semgrep-src.xml", "src")
27+
session.run("semgrep", "scan", "--strict", "--verbose", "src")
28+
29+
2330
@nox.session(name="black-lint", python=_DEFAULT_PYTHON)
2431
def black_lint(session):
2532
session.install("-e", ".[tests]")

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ tests = [
6363
"pytest",
6464
"pytest-cov",
6565
"pytest-xdist",
66+
"semgrep",
6667
"validators",
6768
]
6869
internal = [

0 commit comments

Comments
 (0)