Files
bookmarkmagic/sonar-project.properties
poli0981andClaude Opus 5.5 d9e5815dfe ci: SonarCloud CI analysis with coverage, and a release that never installs while holding a write token
SonarCloud ran Automatic Analysis: no coverage, and a scan of the repo rather
than of what CI builds. sonarcloud.yml replaces it — full-history checkout,
the coverage run, then the scan with the package version as the new-code
baseline. It is its own workflow so a Sonar outage or gate opinion can never
turn CI red, the scan action is pinned to a commit because it holds
SONAR_TOKEN, the token reaches only the two steps that use it, and runs
without secrets (Dependabot, forks) skip with a notice instead of failing.

Coverage now measures every src/**/*.ts module and emits lcov, but the CI
gate is unchanged: a glob threshold applies the docs/11 §1 numbers to
src/lib/core/** only (verified to still fail a run below them).

Hardening, from SonarCloud's findings and the scripts/config audit:
- npm ci --ignore-scripts everywhere, with `wxt prepare` run explicitly;
- checkouts drop persisted credentials;
- release.yml is split: gates and zip run with a read-only token; only a
  job that installs nothing and runs no repo code creates the Release; the
  store submit uses the local wxt binary, never `npx` with secrets in scope;
- reusables get named secrets instead of `inherit`. The announce job could
  never have worked: this repo stores RELEASES_WEBHOOK/REPO_WEBHOOK, the
  reusable reads DISCORD_*, and inherit passed neither;
- CI runs `npm audit --omit=dev`, which docs/09 already claimed it did;
- a non-required Windows smoke job (guard + unit tests).

serializeMarkdown's trailing-newline trim used /\n+$/, which backtracks
quadratically over a long newline run that is not at the end (S8786); it is
now a single backward scan, with a 20k-newline regression test.

docs/12 no longer copies the workflow YAML — the copies drifted three times,
and under docs-win a stale copy invites reverting a pinned action.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 00:06:52 +07:00

29 lines
1.3 KiB
Properties

# SonarCloud — CI-based analysis (docs/12 §2.5). Read by
# .github/workflows/sonarcloud.yml; Automatic Analysis must stay OFF in the
# SonarCloud project (Administration → Analysis Method), or the scan errors out.
sonar.projectKey=poli0981_bookmarkmagic
sonar.organization=poli0981
sonar.projectName=BookmarkMagic
sonar.sourceEncoding=UTF-8
# What ships, plus the repo tooling that guards it.
sonar.sources=src,scripts
# Icons and the _locales message catalogues are data, not code.
sonar.exclusions=src/public/**
sonar.tests=tests
sonar.test.inclusions=tests/**/*.ts
# Fixtures are byte-exact samples of what browsers emit — malformed on purpose
# (a no-doctype HTML file is a test case, not a bug), never something to "fix".
sonar.test.exclusions=tests/fixtures/**
# Coverage scope mirrors docs/11 §1: components, entrypoints and repo scripts
# are verified by the manual QA pass and their own script tests, not by line
# coverage. Everything else in src/ is unit-tested and counted.
sonar.javascript.lcov.reportPaths=coverage/lcov.info
sonar.coverage.exclusions=src/entrypoints/**,src/lib/components/**,**/*.svelte,scripts/**
# The three locale dictionaries are parallel by design (en is the schema, vi/ja
# `satisfies Dict`); their "duplication" is the i18n contract working.
sonar.cpd.exclusions=src/lib/i18n/locales/**