Skip to content

Commit 1863025

Browse files
committed
fix: address SonarQube code quality issues
1 parent 02c7495 commit 1863025

File tree

997 files changed

+42024
-38621
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

997 files changed

+42024
-38621
lines changed

.github/workflows/cd.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# .github/workflows/cd.yml
22
name: treemapper CD
33

4-
permissions:
5-
contents: write
4+
permissions: {}
65

76
'on':
87
workflow_dispatch:
@@ -316,6 +315,8 @@ jobs:
316315
(needs.publish-to-pypi.result == 'success' ||
317316
needs.publish-to-pypi.result == 'skipped')
318317
runs-on: ubuntu-latest
318+
permissions:
319+
contents: write
319320
steps:
320321
- name: Download git bundle
321322
uses: actions/download-artifact@v7

.github/workflows/ci.yml

Lines changed: 12 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# .github/workflows/ci.yml
22
name: treemapper CI
33

4-
permissions:
5-
contents: read
6-
security-events: write # For CodeQL
7-
84
'on':
95
pull_request:
106
branches: ['**']
@@ -19,6 +15,8 @@ jobs:
1915
pre-commit:
2016
name: Pre-commit hooks
2117
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
2220
steps:
2321
- uses: actions/checkout@v6
2422

@@ -47,6 +45,8 @@ jobs:
4745
lint-type-check:
4846
name: Lint & Type Check
4947
runs-on: ubuntu-latest
48+
permissions:
49+
contents: read
5050
steps:
5151
- name: Checkout Code
5252
uses: actions/checkout@v6
@@ -90,6 +90,8 @@ jobs:
9090
python-version: ['3.10', '3.11', '3.12', '3.13']
9191

9292
runs-on: ${{ matrix.os }}
93+
permissions:
94+
contents: read
9395

9496
steps:
9597
- name: Checkout Code
@@ -144,50 +146,15 @@ jobs:
144146
test-results.xml
145147
retention-days: 1
146148

147-
# ============================================================================
148-
# PyPy Compatibility Testing
149-
# ============================================================================
150-
test-pypy:
151-
needs: [pre-commit, lint-type-check]
152-
runs-on: ubuntu-latest
153-
strategy:
154-
fail-fast: false
155-
matrix:
156-
python-version: [pypy-3.10, pypy-3.11]
157-
158-
steps:
159-
- name: Checkout Code
160-
uses: actions/checkout@v6
161-
162-
- name: Set up PyPy ${{ matrix.python-version }}
163-
uses: actions/setup-python@v6
164-
with:
165-
python-version: ${{ matrix.python-version }}
166-
167-
- name: Cache pip Dependencies
168-
uses: actions/cache@v5
169-
with:
170-
path: ~/.cache/pip
171-
key: pypy-${{ matrix.python-version }}-pip-${{ hashFiles('**/pyproject.toml') }}
172-
restore-keys: |
173-
pypy-${{ matrix.python-version }}-pip-
174-
175-
- name: Install Dependencies
176-
run: |
177-
python -m pip install --upgrade pip
178-
pip install -e .
179-
pip install pytest
180-
181-
- name: Run Tests
182-
run: pytest -v
183-
184149
# ============================================================================
185150
# Mutation Testing (test effectiveness validation)
186151
# Evidence: Mutation score correlates with real fault detection
187152
# ============================================================================
188153
mutation-testing:
189154
name: Mutation Testing
190155
runs-on: ubuntu-latest
156+
permissions:
157+
contents: read
191158
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
192159

193160
steps:
@@ -218,6 +185,8 @@ jobs:
218185
complexity-checks:
219186
name: Complexity & Maintainability Analysis
220187
runs-on: ubuntu-latest
188+
permissions:
189+
contents: read
221190

222191
steps:
223192
- uses: actions/checkout@v6
@@ -254,6 +223,8 @@ jobs:
254223
architecture-checks:
255224
name: Architecture & Import Contracts
256225
runs-on: ubuntu-latest
226+
permissions:
227+
contents: read
257228

258229
steps:
259230
- uses: actions/checkout@v6

.gitleaks.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[extend]
2+
useDefault = true
3+
4+
[allowlist]
5+
paths = [
6+
'''\.secrets\.baseline''',
7+
'''tests/cases/diff/kubernetes/k8s_406_secret_reference\.yaml''',
8+
'''tests/cases/diff/kubernetes/k8s_418_image_pull_secret\.yaml''',
9+
]

.pre-commit-config.yaml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ repos:
2929
- id: debug-statements
3030
- id: name-tests-test
3131
args: ["--pytest-test-first"]
32-
exclude: ^tests/(utils|conftest)\.py$
32+
exclude: ^tests/(utils|conftest|framework/.*)\.py$
3333
- id: fix-byte-order-marker
3434
- id: detect-private-key
3535

@@ -100,24 +100,6 @@ repos:
100100
# ============================================================================
101101
# SECURITY & VULNERABILITY DETECTION
102102
# ============================================================================
103-
- repo: https://github.com/trailofbits/pip-audit
104-
rev: v2.9.0
105-
hooks:
106-
- id: pip-audit
107-
name: pip-audit (CVE detection in dependencies)
108-
args:
109-
[
110-
"--desc",
111-
"on",
112-
"--skip-editable",
113-
"--ignore-vuln",
114-
"GHSA-4xh5-x5gv-qwph",
115-
"--ignore-vuln",
116-
"GHSA-gm62-xv2j-4w53",
117-
"--ignore-vuln",
118-
"GHSA-2xpw-w6gg-jr37",
119-
]
120-
121103
- repo: https://github.com/Yelp/detect-secrets
122104
rev: v1.5.0
123105
hooks:

0 commit comments

Comments
 (0)