|
88 | 88 | - Public `api/issues/search?projectKeys=nikolay-e_TreeMapper&statuses=OPEN` |
89 | 89 | works without auth for OPEN issues. Token only needed for hotspot |
90 | 90 | state changes / false-positive transitions. |
| 91 | +- Token lives in macOS Keychain under service `sonarqube-token` (40 chars). |
| 92 | + Auth via `Authorization: Bearer <token>` (NOT basic auth). Use |
| 93 | + `--data-urlencode key=value` for hotspot/issue mutations. |
| 94 | +- Quality gate ERROR conditions for treemapper after a paper-heavy push are |
| 95 | + usually `new_reliability_rating>1` (driven by S3516 BLOCKER bugs) and |
| 96 | + `new_security_hotspots_reviewed<100%`. Hotspots are bulk-resolvable in |
| 97 | + one loop over `/api/hotspots/search?status=TO_REVIEW` — set Safe with |
| 98 | + per-rule comments (S1313 instance-id false positive, S2245 seeded PRNG, |
| 99 | + docker S6471 internal image, S7637 tag-pin policy). Hotspots resolved |
| 100 | + this way DO clear the gate condition immediately on next refresh. |
| 101 | + |
| 102 | +## SonarCloud Recurring Patterns (paper/benchmark commits) |
| 103 | + |
| 104 | +- `python:S3516` BLOCKER on entry-points and orchestrators: appears when a |
| 105 | + function has multiple `return X` statements all of the same name (e.g. |
| 106 | + `return results`) — refactor into single tail-return by extracting |
| 107 | + per-branch helpers, NOT by collapsing branches. |
| 108 | +- `python:S5799` MAJOR (implicit string concat / missing comma): black |
| 109 | + often line-splits long f-strings into adjacent literals (`"..." "..."`). |
| 110 | + Merge into one literal — keep flake8 / ruff aligned with this rule by |
| 111 | + not relying on implicit concat for readability. |
| 112 | +- `python:S1244` MAJOR (float `==`): use `pytest.approx`, not `math.isclose`, |
| 113 | + because the codebase already imports pytest in every test module. |
| 114 | +- `python:S1186` CRITICAL (empty methods): for duck-typed stubs (e.g. |
| 115 | + Aider IO interface) add a one-line docstring describing the no-op — |
| 116 | + `pass` alone is flagged. |
| 117 | +- `python:S1192` CRITICAL (literal duplication ≥3): extract module-private |
| 118 | + `_TWO_COL_DIVIDER` style constant; keep adjacent to imports. |
91 | 119 |
|
92 | 120 | ## CI Build of Rust Extension |
93 | 121 |
|
|
100 | 128 | fail at the build step before any test runs. |
101 | 129 | - Cache cargo per-(os, python-version) — same cargo target dir compiled with |
102 | 130 | different Python ABIs collides if the key doesn't include python-version. |
| 131 | +- `panic = "abort"` in `[profile.release]` is INCOMPATIBLE with |
| 132 | + `cargo test --release` — the test harness force-uses unwind, dependencies |
| 133 | + get abort, link fails. Keep abort for production safety but split CI: |
| 134 | + `cargo test --lib` (dev profile, harness happy) + |
| 135 | + `cargo build --release` + `cargo test --release --test yaml_cases` |
| 136 | + (integration tests with `harness = false` work in release). |
| 137 | +- Bench Dockerfile that copies `diffctx/Cargo.toml` MUST also copy |
| 138 | + `diffctx/tests/` whenever Cargo.toml declares any `[[test]]` entry — |
| 139 | + manifest parser validates path before any build step. |
103 | 140 |
|
104 | 141 | ## YAML Case Runner (cargo integration test) |
105 | 142 |
|
|
0 commit comments