Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.
Python aicode-complexitycode-healthcode-intelligencecode-qualitydead-codedeveloper-toolsdocumentationgit-analyticsmcpopen-sourcepythonrefactoringstatic-analysistechnical-debt
feat(security): the inline ignore marker also silences the stored scan (#3536)
Raghav Chamadiyad82ddf34f9fb
diff --git a/docs/layers/SECURITY.md b/docs/layers/SECURITY.mdindex 3ae3615b4..fddfc89fd 100644--- a/docs/layers/SECURITY.md+++ b/docs/layers/SECURITY.md@@ -190,7 +190,9 @@ upload are in [Repowise in CI](../start/CI.md).Put `repowise-security-ignore` on the finding's own line in any commentsyntax; `repowise-security-ignore: aws_access_key` silences only the kinds itlists. There is no next-line or whole-file form. A silenced finding never fails-the gate and is still reported as suppressed. Exact rules are in the+the gate and is still reported there as suppressed. The scan that indexing+stores leaves it out, so it does not reach the dashboard, `get_risk` or REST.+Exact rules are in the[CLI reference](../reference/CLI_REFERENCE.md#repowise-security-check-revspec).The scanner also honours detect-secrets comments: `# pragma: allowlist secret`diff --git a/packages/core/src/repowise/core/analysis/health/walk_cache.py b/packages/core/src/repowise/core/analysis/health/walk_cache.pyindex a87fd909b..b06f68683 100644--- a/packages/core/src/repowise/core/analysis/health/walk_cache.py+++ b/packages/core/src/repowise/core/analysis/health/walk_cache.py@@ -88,7 +88,8 @@ class HealthWalkCache:self.misses += 1return Nonetry:- value = pickle.loads(blob)+ # Our own dumps, or an entry of the file load_sealed_pickle verified.+ value = pickle.loads(blob) # repowise-security-ignore: pickle_loadsexcept Exception:self.misses += 1return Nonediff --git a/packages/core/src/repowise/core/analysis/security_gate.py b/packages/core/src/repowise/core/analysis/security_gate.pyindex 14f28429d..a99d9f237 100644--- a/packages/core/src/repowise/core/analysis/security_gate.py+++ b/packages/core/src/repowise/core/analysis/security_gate.py@@ -45,6 +45,7 @@ from .security_scan import (SECRET_KINDS,_detect_secrets_allowlisted,_mask_comments_and_strings,+ marker_silences,masked_snippet,scan_source,source_lines,@@ -139,14 +140,6 @@ _CUSTOM_PREFIX = "custom:"_ZERO_WIDTH_PROBE = string.printable_QUANTIFIERS = ("*", "+", "{")-_IGNORE_TOKEN = "repowise-security-ignore"-_IGNORE_RE = re.compile(- rf"{_IGNORE_TOKEN}(?![\w-])"- r"(?:[ \t]*:[ \t]*([\w:-]+(?:[ \t]*,[ \t]*[\w:-]+)*))?"- # A colon no kind list follows is a malformed scope, which silences nothing.- r"(?P<stray>[ \t]*:)?"-)-@dataclass(frozen=True)class CustomPattern:@@ -311,18 +304,6 @@ def _class_end(regex: str, start: int) -> int:return i + 1-def _silenced(line: str, kind: str) -> bool:- """Whether a marker on *line* silences *kind*: the bare token all kinds, ``: a, b`` those."""- if _IGNORE_TOKEN not in line:- return False- match = _IGNORE_RE.search(line)- if match is None or match.group("stray"):- return False- if not match.group(1):- return True- return kind in {k.strip() for k in match.group(1).split(",")}--# ---------------------------------------------------------------------------# Scan# ---------------------------------------------------------------------------@@ -541,7 +522,7 @@ def _row(text: _Text, entry: _Entry) -> dict:"fingerprint": fingerprint,"commit": None,}- if _silenced(text.line(lineno), kind):+ if marker_silences(text.line(lineno), kind):row[_SUPPRESSED] = Truereturn rowdiff --git a/packages/core/src/repowise/core/analysis/security_scan.py b/packages/core/src/repowise/core/analysis/security_scan.pyindex 44b4b42e3..c9a9a834d 100644--- a/packages/core/src/repowise/core/analysis/security_scan.py+++ b/packages/core/src/repowise/core/analysis/security_scan.py@@ -67,6 +67,27 @@ def _detect_secrets_allowlisted()+IGNORE_TOKEN = "repowise-security-ignore"+_IGNORE_RE = re.compile(+ rf"{IGNORE_TOKEN}(?![\w-])"+ r"(?:[ \t]*:[ \t]*([\w:-]+(?:[ \t]*,[ \t]*[\w:-]+)*))?"+ # A colon no kind list follows is a malformed scope, which silences nothing.+ r"(?P<stray>[ \t]*:)?"+)+++def marker_silences(line: str, kind: str) -> bool:+ """Whether a marker on *line* silences *kind*: the bare token all kinds, ``: a, b`` those."""+ if IGNORE_TOKEN not in line:+ return False+ match = _IGNORE_RE.search(line)+ if match is None or match.group("stray"):+ return False+ if not match.group(1):+ return True+ return kind in {k.strip() for k in match.group(1).split(",")}++_CREDENTIAL_EXACT_PLACEHOLDERS: frozenset[str] = frozenset({"password", "changeit"})_CREDENTIAL_SUBSTRING_PLACEHOLDERS: tuple[str, ...] = (@@ -1055,6 +1076,15 @@ def scan_source_map(source_text = raw or ""scanned_paths.append(path)findings = scan_source(path, source_text, pf.symbols)+ if findings and IGNORE_TOKEN in source_text:+ # The gate keeps a silenced finding to report it as suppressed; the+ # stored scan is what the dashboard and agents read, so it drops it.+ lines = source_lines(source_text)+ findings = [+ f+ for f in findings+ if not (0 < f["line"] <= len(lines) and marker_silences(lines[f["line"] - 1], f["kind"]))+ ]if findings:findings_by_file[path] = findingsreturn findings_by_file, scanned_pathsdiff --git a/packages/core/src/repowise/core/ingestion/parse_cache.py b/packages/core/src/repowise/core/ingestion/parse_cache.pyindex 136d6b5e9..d1506d04c 100644--- a/packages/core/src/repowise/core/ingestion/parse_cache.py+++ b/packages/core/src/repowise/core/ingestion/parse_cache.py@@ -169,7 +169,8 @@ class ParseCache:self.misses += 1return Nonetry:- parsed: Any = pickle.loads(blob)+ # An entry of the cache file load_sealed_pickle verified on load.+ parsed: Any = pickle.loads(blob) # repowise-security-ignore: pickle_loadsexcept Exception as exc: # corrupt entry -> re-parse this filelog.debug("parse_cache_entry_corrupt", path=file_info.path, error=str(exc))self.misses += 1diff --git a/packages/ui/src/files/file-coverage-tab.tsx b/packages/ui/src/files/file-coverage-tab.tsxindex 72f5114f7..043434c9e 100644--- a/packages/ui/src/files/file-coverage-tab.tsx+++ b/packages/ui/src/files/file-coverage-tab.tsx@@ -147,7 +147,7 @@ export function FileCoverageTab({>{/* Highlighted by the host through the shared shiki path; thedata-covered line attributes drive the gutter tint below. */}- <div dangerouslySetInnerHTML={{ __html: coverageCodeHtml }} />+ <div dangerouslySetInnerHTML={{ __html: coverageCodeHtml /* shiki output; repowise-security-ignore: unsafe_inner_html */ }} /><style>{`.coverage-code pre { margin: 0; padding: 0.75rem 0; background: transparent !important; }.coverage-code code { display: block; }diff --git a/packages/ui/src/shared/code-block.tsx b/packages/ui/src/shared/code-block.tsxindex 255fe66db..ba2751f37 100644--- a/packages/ui/src/shared/code-block.tsx+++ b/packages/ui/src/shared/code-block.tsx@@ -119,7 +119,7 @@ export function HighlightedCodeBlock({{...(className ? { className } : {})}>{!streaming && html ? (- <div dangerouslySetInnerHTML={{ __html: html }} />+ <div dangerouslySetInnerHTML={{ __html: html /* shiki output; repowise-security-ignore: unsafe_inner_html */ }} />) : (<pre><code>{code}</code>diff --git a/packages/ui/src/wiki/code-block.tsx b/packages/ui/src/wiki/code-block.tsxindex 04e75899a..567d03e9d 100644--- a/packages/ui/src/wiki/code-block.tsx+++ b/packages/ui/src/wiki/code-block.tsx@@ -53,7 +53,7 @@ export function CodeBlock({ code, language, html }: CodeBlockProps) {<divclassName="overflow-x-auto text-sm [&>pre]:p-4 [&>pre]:m-0 [&>pre]:bg-transparent!"- dangerouslySetInnerHTML={{ __html: html }}+ dangerouslySetInnerHTML={{ __html: html /* shiki output; repowise-security-ignore: unsafe_inner_html */ }}/></div>);diff --git a/packages/ui/src/wiki/wiki-markdown.tsx b/packages/ui/src/wiki/wiki-markdown.tsxindex ffbd2c5bd..d71173418 100644--- a/packages/ui/src/wiki/wiki-markdown.tsx+++ b/packages/ui/src/wiki/wiki-markdown.tsx@@ -103,7 +103,7 @@ function ClientCodeBlock({ code, language }: { code: string; language: string }){html ? (<divclassName="overflow-x-auto text-sm [&>pre]:p-4 [&>pre]:m-0 [&>pre]:bg-transparent!"- dangerouslySetInnerHTML={{ __html: html }}+ dangerouslySetInnerHTML={{ __html: html /* shiki output; repowise-security-ignore: unsafe_inner_html */ }}/>) : (<pre className="overflow-x-auto p-4 bg-[var(--color-bg-inset)]">diff --git a/tests/unit/analysis/test_security_scan.py b/tests/unit/analysis/test_security_scan.pyindex b7f8c09db..1df7b9900 100644--- a/tests/unit/analysis/test_security_scan.py+++ b/tests/unit/analysis/test_security_scan.py@@ -319,13 +319,13 @@ class TestScanFile:@pytest.mark.parametrize(("source", "expected_kind"),[- ('AWS_ACCESS_KEY_ID = "AKIAQZXNRTVYWMPKLBHG"\n', "aws_access_key"),+ ('AWS_ACCESS_KEY_ID = "AKIAQZXNRTVYWMPKLBHG"\n', "aws_access_key"), # pragma: allowlist secret(- 'GITHUB_TOKEN = "ghp_abcdefghijklmnopqrstuvwxyzABCDEFGHIJ"\n',+ 'GITHUB_TOKEN = "ghp_abcdefghijklmnopqrstuvwxyzABCDEFGHIJ"\n', # pragma: allowlist secret"github_token",),(- "GH_APP_TOKEN = 'ghu_abcdefghijklmnopqrstuvwxyzABCDEFGHIJ'\n",+ "GH_APP_TOKEN = 'ghu_abcdefghijklmnopqrstuvwxyzABCDEFGHIJ'\n", # pragma: allowlist secret"github_token",),(@@ -334,9 +334,9 @@ class TestScanFile:+ '"\n',"github_token",),- ('SLACK_BOT_TOKEN = "xoxb-4721609583-T5Rk9mPz2Qa"\n', "slack_token"),+ ('SLACK_BOT_TOKEN = "xoxb-4721609583-T5Rk9mPz2Qa"\n', "slack_token"), # pragma: allowlist secret(- 'GOOGLE_MAPS_API_KEY = "AIzaSyD9K2vQ7xR4mZ1pL8tY6wU3nB0cF5hD9aX"\n',+ 'GOOGLE_MAPS_API_KEY = "AIzaSyD9K2vQ7xR4mZ1pL8tY6wU3nB0cF5hD9aX"\n', # pragma: allowlist secret"google_api_key",),(@@ -371,7 +371,7 @@ class TestScanFile:"""A vendor key is invisible to the keyword list under a name like``client_id``, so it must be caught by the value shape alone."""scanner = SecurityScanner(session=None, repo_id="r1") # type: ignore[arg-type]- source = 'client_id = "AKIAQZXNRTVYWMPKLBHG"\n'+ source = 'client_id = "AKIAQZXNRTVYWMPKLBHG"\n' # pragma: allowlist secretfindings = asyncio.run(scanner.scan_file("config.py", source, symbols=[]))assert any(f["kind"] == "aws_access_key" for f in findings)@@ -402,7 +402,7 @@ class TestScanFile:"""#2121's value gate must apply to the new vendor kinds too: alow-severity path downgrades severity, same as the keyword kinds."""scanner = SecurityScanner(session=None, repo_id="r1") # type: ignore[arg-type]- source = 'AWS_ACCESS_KEY_ID = "AKIAQZXNRTVYWMPKLBHG"\n'+ source = 'AWS_ACCESS_KEY_ID = "AKIAQZXNRTVYWMPKLBHG"\n' # pragma: allowlist secretfindings = asyncio.run(scanner.scan_file("tests/fixtures/keys.py", source, symbols=[]))hits = [f for f in findings if f["kind"] == "aws_access_key"]assert len(hits) == 1@@ -822,7 +822,7 @@ class TestScanSource:@pytest.mark.parametrize(("source", "raw"),[- ("NEXT_PUBLIC_STRIPE_SECRET_KEY=sk_live_0123456789abcdef\n", "sk_live_0123456789abcdef"),+ ("NEXT_PUBLIC_STRIPE_SECRET_KEY=sk_live_0123456789abcdef\n", "sk_live_0123456789abcdef"), # pragma: allowlist secret(' "VITE_API_KEY": "abcdef0123456789",\n', "abcdef0123456789"),("export const NEXT_PUBLIC_AUTH_TOKEN = 'tok_9876543210';\n", "tok_9876543210"),],@@ -877,6 +877,28 @@ class TestScanSource:assert set(findings_by_file) == {"a.py"}assert findings_by_file["a.py"] == scan_source("a.py", SNIPPY.decode())+ def test_ignore_marker_silences_the_stored_scan(self) -> None:+ source = (+ "data = pickle.loads(blob) # repowise-security-ignore: pickle_loads\n"+ "other = pickle.loads(raw) # repowise-security-ignore: eval_call\n"+ "os.system(cmd) # repowise-security-ignore\n"+ "os.system(cmd2)\n"+ )+ # The gate reads scan_source and reports silenced findings as suppressed.+ assert len(scan_source("a.py", source)) == 4+ result = _fake_result({"a.py": source})+ findings_by_file, _ = scan_source_map(result.parsed_files, result.source_map)+ assert sorted((f["kind"], f["line"]) for f in findings_by_file["a.py"]) == [+ ("os_system", 4),+ ("pickle_loads", 2),+ ]++ def test_a_fully_silenced_file_stores_nothing(self) -> None:+ source = "data = pickle.loads(blob) # repowise-security-ignore\n"+ result = _fake_result({"a.py": source})+ findings_by_file, scanned = scan_source_map(result.parsed_files, result.source_map)+ assert scanned == ["a.py"] and findings_by_file == {}+def _assert_no_raw(snippet: str, raw: str) -> None:leaked = [raw[i : i + 5] for i in range(len(raw) - 4) if raw[i : i + 5] in snippet]@@ -1012,7 +1034,7 @@ class TestVendorShapeEdges:assert "hardcoded_secret" not in self._kinds(source)def test_vendor_shape_and_keyword_report_one_finding(self) -> None:- source = 'GITHUB_TOKEN = "ghp_abcdefghijklmnopqrstuvwxyzABCDEFGHIJ"\n'+ source = 'GITHUB_TOKEN = "ghp_abcdefghijklmnopqrstuvwxyzABCDEFGHIJ"\n' # pragma: allowlist secretassert self._kinds(source) == ["github_token"]def test_pem_key_with_escaped_newline_is_flagged(self) -> None:@@ -1023,11 +1045,11 @@ class TestVendorShapeEdges:assert "private_key_pem" in self._kinds(source, ".env")def test_google_key_ending_in_a_dash_is_flagged(self) -> None:- source = 'MAPS_KEY = "AIzaSyD9K2vQ7xR4mZ1pL8tY6wU3nB0cF5hD9a-"\n'+ source = 'MAPS_KEY = "AIzaSyD9K2vQ7xR4mZ1pL8tY6wU3nB0cF5hD9a-"\n' # pragma: allowlist secretassert "google_api_key" in self._kinds(source)def test_google_shape_inside_an_integrity_hash_is_ignored(self) -> None:- run = "AIzaSyD9K2vQ7xR4mZ1pL8tY6wU3nB0cF5hD9aX"+ run = "AIzaSyD9K2vQ7xR4mZ1pL8tY6wU3nB0cF5hD9aX" # pragma: allowlist secretfor integrity in (f"sha512-{run}+Q==", f"sha512-Zm9v/{run}/b2=="):source = f' "integrity": "{integrity}",\n'assert "google_api_key" not in self._kinds(source, "package-lock.json")@@ -1092,14 +1114,14 @@ class TestForgeSecretShapes:@pytest.mark.parametrize("url",[- "https://deploy:[email protected]/group/repo.git",- "https://ci:[email protected]/owner/repo",- "https://ci:[email protected]:443/o/r",- "git+https://ci:[email protected]/o/r",- "https://org:[email protected]/org/p/_git/r",- "https://org:[email protected]/p/_git/r",- "ssh://ci:[email protected]:2222/o/r.git",- "http://ci:[email protected]/o/r.git/info/refs",+ "https://deploy:[email protected]/group/repo.git", # pragma: allowlist secret+ "https://ci:[email protected]/owner/repo", # pragma: allowlist secret+ "https://ci:[email protected]:443/o/r", # pragma: allowlist secret+ "git+https://ci:[email protected]/o/r", # pragma: allowlist secret+ "https://org:[email protected]/org/p/_git/r", # pragma: allowlist secret+ "https://org:[email protected]/p/_git/r", # pragma: allowlist secret+ "ssh://ci:[email protected]:2222/o/r.git", # pragma: allowlist secret+ "http://ci:[email protected]/o/r.git/info/refs", # pragma: allowlist secret],)def test_git_remote_credentials_fire(self, url: str) -> None:@@ -1157,8 +1179,8 @@ class TestForgeSecretShapes:@pytest.mark.parametrize(("source", "kind"),[- ('password = "https://ci:[email protected]/o/r.git"\n', "hardcoded_password"),- ('API_KEY = "https://svc:[email protected]/o/r"\n', "hardcoded_secret"),+ ('password = "https://ci:[email protected]/o/r.git"\n', "hardcoded_password"), # pragma: allowlist secret+ ('API_KEY = "https://svc:[email protected]/o/r"\n', "hardcoded_secret"), # pragma: allowlist secret],)def test_keyword_named_url_credential_keeps_its_kind(self, source: str, kind: str) -> None:@@ -1166,7 +1188,7 @@ class TestForgeSecretShapes:assert self._kinds(source) == [kind]def test_url_credentials_in_prose_fire(self) -> None:- source = "Clone with `git clone https://ci:[email protected]/r.git`.\n"+ source = "Clone with `git clone https://ci:[email protected]/r.git`.\n" # pragma: allowlist secretassert self._kinds(source, "README.md") == ["git_url_credentials"]@@ -1196,7 +1218,7 @@ class TestCallKindsIgnoreProseAndText:assert self._hits(source, "docs/CHANGELOG.md") == []def test_secret_in_markdown_is_still_flagged(self) -> None:- source = 'AWS_ACCESS_KEY_ID = "AKIAQZXNRTVYWMPKLBHG"\n'+ source = 'AWS_ACCESS_KEY_ID = "AKIAQZXNRTVYWMPKLBHG"\n' # pragma: allowlist secretkinds = [f["kind"] for f in scan_source("README.md", source)]assert "aws_access_key" in kinds@@ -1317,5 +1339,5 @@ class TestSecretPrecision:assert self._kinds(source) == {"hardcoded_password"}def test_vendor_key_in_a_comment_still_fires(self) -> None:- kinds = {f["kind"] for f in scan_source("src/app.py", "# AKIAQZXNRTVYWMPKLBHG\n")}+ kinds = {f["kind"] for f in scan_source("src/app.py", "# AKIAQZXNRTVYWMPKLBHG\n")} # pragma: allowlist secretassert kinds == {"aws_access_key"}diff --git a/tests/unit/cli/test_progress_non_tty.py b/tests/unit/cli/test_progress_non_tty.pyindex 314011832..421939a9b 100644--- a/tests/unit/cli/test_progress_non_tty.py+++ b/tests/unit/cli/test_progress_non_tty.py@@ -246,7 +246,7 @@ def test_a_key_quoted_back_by_a_provider_is_not_written_to_disk() -> None:("register: GR1348941" + "0123456789abcdefghij", "register: [redacted]"),("pat " + "0123456789ABCDEFGHIJ" * 3 + "0123456789abcdef" + "AZDO0123", "pat [redacted]"),(- "fatal: could not read https://ci:[email protected]/r.git",+ "fatal: could not read https://ci:[email protected]/r.git", # pragma: allowlist secret"fatal: could not read https://***@git.internal/r.git",),# Nothing to hide: a username alone, an scp-style remote, a plain URL.diff --git a/tests/unit/distill/test_cli.py b/tests/unit/distill/test_cli.pyindex 5a1be18ec..67ec74bea 100644--- a/tests/unit/distill/test_cli.py+++ b/tests/unit/distill/test_cli.py@@ -151,7 +151,7 @@ def test_render_command_roundtrips_argv_through_the_shell(payload: str, tmp_pathrender and reads the child's ``sys.argv`` back."""tokens = (sys.executable, "-c", "import sys,json;print(json.dumps(sys.argv[1:]))", payload)- proc = subprocess.run(+ proc = subprocess.run( # repowise-security-ignore: subprocess_shell_true_render_command(tokens),shell=True,capture_output=True,@@ -185,7 +185,7 @@ def test_render_command_keeps_an_executable_path_with_spaces_intact(tmp_path: Pa# renderer. Argument fidelity is covered by the parametrized test above.shim.write_text("@echo SHIM_OK\n", encoding="utf-8")- proc = subprocess.run(+ proc = subprocess.run( # repowise-security-ignore: subprocess_shell_true_render_command((str(shim), "arg one", "a&b")),shell=True,capture_output=True,diff --git a/tests/unit/ingestion/test_parse_cache.py b/tests/unit/ingestion/test_parse_cache.pyindex 384aeb7ba..da994f07b 100644--- a/tests/unit/ingestion/test_parse_cache.py+++ b/tests/unit/ingestion/test_parse_cache.py@@ -134,7 +134,7 @@ def test_corrupt_cache_falls_back_to_full_parse(repo):def test_fingerprint_mismatch_invalidates(repo, tmp_path):_build(repo)cache_file = _cache_path(repo)- payload = pickle.loads(unseal(cache_file.read_bytes(), domain=_CACHE_DOMAIN))+ payload = pickle.loads(unseal(cache_file.read_bytes(), domain=_CACHE_DOMAIN)) # repowise-security-ignore: pickle_loadsassert payload["fingerprint"] == parser_fingerprint()payload["fingerprint"] = "stale-fingerprint"cache_file.write_bytes(seal(pickle.dumps(payload), domain=_CACHE_DOMAIN))@@ -162,7 +162,7 @@ def test_dataclass_schema_change_invalidates_cache(repo, monkeypatch):_build(repo) # populate the cache under the current fingerprintcache_file = _cache_path(repo)assert (- pickle.loads(unseal(cache_file.read_bytes(), domain=_CACHE_DOMAIN))["fingerprint"]+ pickle.loads(unseal(cache_file.read_bytes(), domain=_CACHE_DOMAIN))["fingerprint"] # repowise-security-ignore: pickle_loads== parser_fingerprint())@@ -177,7 +177,7 @@ def test_dataclass_schema_change_invalidates_cache(repo, monkeypatch):try:assert (parser_fingerprint()- != pickle.loads(unseal(cache_file.read_bytes(), domain=_CACHE_DOMAIN))[+ != pickle.loads(unseal(cache_file.read_bytes(), domain=_CACHE_DOMAIN))[ # repowise-security-ignore: pickle_loads"fingerprint"])@@ -240,7 +240,7 @@ def test_deleted_files_age_out_of_cache(repo):_build(repo)(repo / "other.py").unlink()_build(repo) # rewrite keeps only entries touched this run- payload = pickle.loads(unseal(_cache_path(repo).read_bytes(), domain=_CACHE_DOMAIN))+ payload = pickle.loads(unseal(_cache_path(repo).read_bytes(), domain=_CACHE_DOMAIN)) # repowise-security-ignore: pickle_loadscached_paths = {path for path, _hash in payload["files"]}assert "other.py" not in cached_pathsassert "main.py" in cached_pathsdiff --git a/tests/unit/server/test_security.py b/tests/unit/server/test_security.pyindex 22196a28f..4e7bb767d 100644--- a/tests/unit/server/test_security.py+++ b/tests/unit/server/test_security.py@@ -200,7 +200,7 @@ async def test_masked_credential_snippet_still_locates_its_line("""A masked snippet is not verbatim on its line, but the code is still there."""repo = await create_test_repo(client)src = Path(repo["local_path"]) / "app.py"- src.write_text("import os\n\nAPI_KEY = 'sk_live_0123456789'\n")+ src.write_text("import os\n\nAPI_KEY = 'sk_live_0123456789'\n") # pragma: allowlist secretawait _insert(app.state.session_factory,@@ -285,7 +285,7 @@ async def test_working_tree_finding_has_no_commit_date(client: AsyncClient, app)def test_snippet_cut_inside_a_mask_still_locates_its_line() -> None:from repowise.server.services.security_lines import check_finding_line- line = 'API_KEY = "sk_live_0123456789"'+ line = 'API_KEY = "sk_live_0123456789"' # pragma: allowlist secretcheck = check_finding_line(["", line], 1, 'API_KEY = "sk_l**', "hardcoded_secret")assert check.line_number == 2assert check.verified is True