Skip to content

Commit a7fa770

Browse files
authored
Add local CodeQL analysis targets to Makefile (#209)
1 parent 3a38cab commit a7fa770

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,7 @@ venv/
4242

4343
docs/plans/
4444
.claude/*local*
45+
46+
# CodeQL
47+
.codeql-db
48+
codeql-results.sarif

Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,19 @@ test:
1111

1212
pypi:
1313
python setup.py sdist bdist_wheel upload
14+
15+
CODEQL_DB = .codeql-db
16+
CODEQL_PYTHON = .venv/bin/python
17+
18+
codeql-db:
19+
rm -rf $(CODEQL_DB)
20+
codeql database create $(CODEQL_DB) --language=python --source-root=. \
21+
--extractor-option=python.python_executable=$(CODEQL_PYTHON)
22+
23+
codeql-analyze: codeql-db
24+
codeql pack download codeql/python-queries
25+
codeql database analyze $(CODEQL_DB) codeql/python-queries \
26+
--format=sarif-latest --output=codeql-results.sarif
27+
28+
codeql-clean:
29+
rm -rf $(CODEQL_DB) codeql-results.sarif

0 commit comments

Comments
 (0)