diff --git a/.deepsource/analyzer/Makefile b/.deepsource/analyzer/Makefile index 2f837ab..b8b32e7 100644 --- a/.deepsource/analyzer/Makefile +++ b/.deepsource/analyzer/Makefile @@ -1,6 +1,10 @@ build: cp -r ../../. /app - apk add py-pip + apk add python3-dev py-pip build-base # install semgrep mkdir /toolbox/venv pip install --target=/toolbox/venv semgrep + ls /toolbox/venv + ls /toolbox/venv/bin + ls /toolbox + ls /macrocode diff --git a/.deepsource/analyzer/analyzer.toml b/.deepsource/analyzer/analyzer.toml index 9595aea..fbe885f 100644 --- a/.deepsource/analyzer/analyzer.toml +++ b/.deepsource/analyzer/analyzer.toml @@ -1,5 +1,5 @@ name = "Django smells" description = "My custom Django rules, written in semgrep" -analysis_command = "PYTHONPATH=/toolbox/venv:$PYTHONPATH python3 /app/analyze.py" +analysis_command = "PATH=/toolbox/venv/bin:$PATH PYTHONPATH=/toolbox/venv:$PYTHONPATH python3 /app/analyze.py" visibility = "public" category = "language" diff --git a/.deepsource/analyzer/issues/DJ-001.toml b/.deepsource/analyzer/issues/DJ-001.toml index 5033c95..f3327a4 100644 --- a/.deepsource/analyzer/issues/DJ-001.toml +++ b/.deepsource/analyzer/issues/DJ-001.toml @@ -7,3 +7,4 @@ A `count()` call performs a `SELECT COUNT(*)` behind the scenes, so you should a Check the doc for more reference – https://docs.djangoproject.com/en/3.2/ref/models/querysets/#count """ recommended = true +weight = 90 diff --git a/.deepsource/analyzer/issues/DJ-002.toml b/.deepsource/analyzer/issues/DJ-002.toml index 97c4f1c..f02e53c 100644 --- a/.deepsource/analyzer/issues/DJ-002.toml +++ b/.deepsource/analyzer/issues/DJ-002.toml @@ -17,3 +17,4 @@ Entry.objects.latest('pub_date') Read more about `latest` here – https://docs.djangoproject.com/en/3.2/ref/models/querysets/#latest """ recommended = true +weight = 90 diff --git a/analyze.py b/analyze.py index 6d344e6..640f1b3 100644 --- a/analyze.py +++ b/analyze.py @@ -16,7 +16,7 @@ files_to_analyze = [filename for filename in get_files(codepath) if filename.endswith(".py")] analysis_command = [ - "semgrep", + "/toolbox/venv/bin/semgrep", "--json", "-o", resultpath,