diff --git a/.github/workflows/autoformat-pixeebot-prs.yaml b/.github/workflows/autoformat-pixeebot-prs.yaml index 560abe64..9baa1cc0 100644 --- a/.github/workflows/autoformat-pixeebot-prs.yaml +++ b/.github/workflows/autoformat-pixeebot-prs.yaml @@ -27,6 +27,6 @@ jobs: run: black . - name: Commit and push changes - uses: stefanzweifel/git-auto-commit-action@v5 + uses: stefanzweifel/git-auto-commit-action@v6 with: commit_message: ":art: Apply formatting" diff --git a/.github/workflows/sonar_pixee.yml b/.github/workflows/sonar_pixee.yml index d590b142..2802d749 100644 --- a/.github/workflows/sonar_pixee.yml +++ b/.github/workflows/sonar_pixee.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest if: ${{ github.event.check_run.name == 'SonarCloud Code Analysis' }} steps: - - uses: pixee/upload-tool-results-action@v2 + - uses: pixee/upload-tool-results-action@v2.5.0 with: tool: sonar sonar-token: ${{ secrets.SONAR_TOKEN }} diff --git a/pyproject.toml b/pyproject.toml index bc4af611..356cb79b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,11 +52,11 @@ get-hashes = 'codemodder.scripts.get_hashes:main' [project.optional-dependencies] semgrep = [ - "semgrep>=1.123,<1.124", + "semgrep>=1.125,<1.126", ] test = [ "azure-ai-inference>=1.0.0b1,<2.0", - "coverage>=7.8,<7.9", + "coverage>=7.9,<7.10", "coverage-threshold~=0.4", "defusedxml==0.7.1", "types-defusedxml==0.7.0.20250516", @@ -67,7 +67,7 @@ test = [ "Jinja2~=3.1.2", "jsonschema~=4.24.0", "lxml>=5.3.0,<6.0.0", - "openai>=1.84,<1.85", + "openai>=1.86,<1.87", "mock==5.2.*", "pre-commit<5", "Pyjwt~=2.10.0", @@ -81,19 +81,20 @@ test = [ "security==1.3.1", "types-mock==5.2.*", "django>=4,<6", - "numpy~=2.2.1", + "numpy ~= 2.2.1; python_version == '3.10'", + "numpy ~= 2.3.0; python_version > '3.10'", "flask_wtf~=1.2.0", "fickling~=0.1.0,>=0.1.3", "graphql-server~=3.0.0b7", "unidiff>=0.7.5", - "semgrep>=1.123,<1.124", + "semgrep>=1.125,<1.126", ] complexity = [ "radon==6.0.*", "xenon==0.9.*", ] openai = [ - "openai>=1.84,<1.85", + "openai>=1.86,<1.87", ] azure = [ "azure-ai-inference>=1.0.0b1,<2.0", diff --git a/src/core_codemods/sonar/results.py b/src/core_codemods/sonar/results.py index 2c6025ae..26ac9de4 100644 --- a/src/core_codemods/sonar/results.py +++ b/src/core_codemods/sonar/results.py @@ -120,8 +120,7 @@ def from_json(cls, json_file: str | Path) -> Self: result_set = cls() for result in data.get("issues", []) + data.get("hotspots", []): - if result["status"].lower() in ("open", "to_review"): - result_set.add_result(SonarResult.from_result(result)) + result_set.add_result(SonarResult.from_result(result)) return result_set except Exception: diff --git a/tests/test_results.py b/tests/test_results.py index 97990596..34ef8592 100644 --- a/tests/test_results.py +++ b/tests/test_results.py @@ -216,39 +216,6 @@ def test_or(self, tmpdir): result2["python:S5659"][Path("code.py")][0], ] - def test_sonar_only_open_issues(self, tmpdir): - issues = { - "issues": [ - { - "rule": "python:S5659", - "status": "OPEN", - "component": "code.py", - "textRange": { - "startLine": 1, - "endLine": 1, - "startOffset": 1, - "endOffset": 1, - }, - }, - { - "rule": "python:S5659", - "status": "RESOLVED", - "component": "code.py", - "textRange": { - "startLine": 1, - "endLine": 1, - "startOffset": 1, - "endOffset": 1, - }, - }, - ] - } - sonar_json1 = Path(tmpdir) / "sonar1.json" - sonar_json1.write_text(json.dumps(issues)) - - result = SonarResultSet.from_json(sonar_json1) - assert len(result["python:S5659"][Path("code.py")]) == 1 - def test_sonar_flows(self, tmpdir): issues = { "issues": [