Repository navigation
Description
Goal
The deny.toml exceptions check no longer silently ignores a deny.toml exceptions entry that follows a string containing # on the same line.
Context
Follow-up of #1599 (PR #1600): the review noticed that comment stripping in parseExceptions (scripts/generate-third-party-notices.mjs:189, l.replace(/#.*$/, "")) also cuts at a # inside a string. A line such as licenses = { allow = ["#"], exceptions = [{ crate = "x", allow = ["GPL-2.0"] }] } therefore makes parseExceptions return [] with no message, and the exception form is neither read nor rejected. The same applies to a "exceptions" spelling after such a string. Confirmed on develop and on the PR branch. Callers: generate-third-party-notices.mjs:773 and check-license-compat.mjs. Spec 0090 A12 (allowed dependency terms, single sqlcipher-src exception) implies an unreadable exception list must not pass silently.
Requirements
- Comment stripping only removes a
#that is outside a basic string ("…", with backslash escapes) or a literal string ('…'). Chosen option: a small string-aware stripper. - Behaviour for ordinary comments, commented-out forms and CRLF stays unchanged.
- Existing rejections stay unchanged.
Acceptance Criteria
- The one-line example above (with
"#"inallow) is parsed to thexexception, or rejected with a message naming the form; it never yields[]silently. - A
#inside a basic string and inside a literal string does not start a comment. - A real trailing comment after a string is still stripped; commented-out
exceptionsforms still do not throw. - CRLF input behaves the same as LF.
- The repo
deny.tomlstill parses to thesqlcipher-srcentry. - Regression tests in
licenseCompatCheck.test.tsfail against the current parser and pass with the fix. - Relevant automated tests pass (
npx vitest run src/licenseCompatCheck.test.ts,npm run lint)
Technical Notes
Build tooling only; fail-closed direction, nothing may be loosened. Line 251 (replace(/#[^\n]*/g, "") on the block rest) has the same pattern; check whether it needs the same treatment.
Files: scripts/generate-third-party-notices.mjs, apps/smart-ssh-community/frontend/src/licenseCompatCheck.test.ts
Spec impact: none
Open questions
- Alternative: reject any line with
#inside a string instead of parsing it. Simpler, but rejects valid files; the string-aware stripper is recommended.
Related Work
- Reject escaped quoted keys in deny.toml exceptions in the license check #1599, PR fix(ci): reject escaped quoted keys in deny.toml exceptions #1600, Fail on unparseable deny.toml exceptions instead of skipping them #1588, Fail on array-of-tables and dotted deny.toml exceptions #1595, Reject quoted-key and inline-table deny.toml exceptions in the license check #1597
Activity
fix(ci): strip deny.toml comments string-aware so '#' in a string can…
smart-ssh-coder commentedon Nov 25, 2026
Implementation ready for review. PR #1602. parseExceptions now strips deny.toml comments string-aware (basic and literal strings), so a # inside a string no longer hides an exceptions form; regression tests added (fail on old parser), CI green on PR #1602.
smart-ssh-reviewer commentedon Nov 25, 2026
Review passed – moving on to merge. Approved. parseExceptions now strips deny.toml comments only outside basic and literal strings. A '#' inside a string can no longer hide an exceptions form: the issue's one-line example is rejected as an inline table, for LF and CRLF. Counter-proof done: the new regression test fails against the develop parser and passes with the fix. Removing the second comment strip on the block rest only makes the parser stricter. Existing rejections, the repo deny.toml (sqlcipher-src) and both callers are unchanged. Local runs: vitest 54 passed, npm run lint clean. CI is green. Spec none is correct (build tooling, Spec 0090 A12 unchanged).
fix(ci): strip deny.toml comments string-aware so '#' in a string can…
smart-ssh-coordinator commentedon Nov 25, 2026
Merged and branch deleted: PR #1602 (squash) in develop