summaryrefslogtreecommitdiff
path: root/docs/LINTING.txt
diff options
context:
space:
mode:
authorDoan Luu Duc Tai <doan@luuduct.ai>2026-10-31 17:54:29 -0500
committerDoan Luu Duc Tai <doan@luuduct.ai>2026-10-31 17:54:29 -0500
commit5b89c370d5974f057306a52089f14c337565fd1d (patch)
treed75b3360ec074337c50194874dc2426543d6f764 /docs/LINTING.txt
parent536ead7243a4d2d8d75eb13159a3d00be4624cae (diff)
docs: shorten guides and map repository files
Diffstat (limited to 'docs/LINTING.txt')
-rw-r--r--docs/LINTING.txt243
1 files changed, 109 insertions, 134 deletions
diff --git a/docs/LINTING.txt b/docs/LINTING.txt
index 33084e9..bd1cdac 100644
--- a/docs/LINTING.txt
+++ b/docs/LINTING.txt
@@ -15,153 +15,129 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
STRICT LINT POLICY
- Cargo.toml is the workspace policy; all four packages inherit it.
-
- Forbid rejects source-level attempts to lower a lint. Deny rejects a
- violation but permits a narrower source-level override. Neither prevents
- someone from changing the build configuration itself. Compiler/tool versions
- are pinned, and the checked build is the supported development path.
+ Cargo.toml defines workspace policy; all four packages inherit it.
+ forbid rejects source-level lowering; deny permits narrower source overrides.
+ Neither prevents build-config edits. Pin compiler/tools; use checked builds.
RUST AND CLIPPY
- Every previously denied individual Clippy rule and every enabled Clippy
- group now uses forbid. There are no blanket Clippy allow entries. This
- includes all, correctness, suspicious, cargo, style, complexity, perf,
- pedantic, nursery, multiple_crate_versions, and redundant_pub_crate.
- All Rustdoc lints in its supported all group are forbidden too.
-
- Rust safety, documentation, visibility, casts, edition/future compatibility,
- underscore bindings, and warnings use forbid. Unused-group members that do
- not conflict with generated code are independently forbidden. Additional
- restrictions cover panic/unimplemented/unreachable paths, panic inside Result
- functions, unsafe allowance attributes, numeric/pointer casts, native-endian
- data, string slicing, infinite loops, and test placement. Cargo.toml lists
- the precise rules. Contradictory restriction groups are not enabled wholesale.
-
- The supported workarounds were implemented instead of lowering these rules:
-
- Clap derives became explicit checked Clap builders. All argument parsing
- stays in Clap; application code does not implement a shell parser.
- Both command schemas have regression tests for modes, required paths,
- listener parsing, global --root, and maintenance conflicts. Help flags
- and rejected-option exit codes were compared against the previous binaries.
- The unused Clap derive feature and its lockfile dependency were removed.
-
- Tokio's runtime attribute became an explicit checked runtime builder.
- Runtime construction errors propagate through the existing error path.
- The broad generated expect/style/complexity allowances are no longer needed.
-
- Management and server implementations live inside private app namespaces.
- Internal interfaces use pub(super), narrower than crate visibility. Only
- the documented program entry point is re-exported at the binary root.
- This satisfies both redundant_pub_crate and unreachable_pub without
- exposing helper modules or allowing either lint.
-
- Serde containers specify crate = "serde". This supported attribute avoids
- the generated extern-crate branch and its unused_extern_crates and
- clippy::useless_attribute allowances. File and wire representations retain
- their existing field names, ordering, tagging, and unknown-field checks.
-
- Result-returning tests report failed checks with anyhow::ensure instead
- of panicking. This permits panic_in_result_fn without suppressions.
+ Every formerly denied individual Clippy rule and enabled group uses forbid.
+ No blanket allows. Groups include all, correctness, suspicious, cargo, style,
+ complexity, perf, pedantic, nursery; multiple_crate_versions and
+ redundant_pub_crate also remain forbidden. Forbid Rustdoc's supported all group.
+
+ Forbid Rust safety/docs/visibility/cast/edition/future-compatibility checks,
+ underscore bindings, and warnings. Independently forbid unused-group members
+ compatible with generated code. Also restrict panic/unimplemented/unreachable
+ paths, panic in Result, unsafe allowance attributes, numeric/pointer casts,
+ native-endian data, string slices, infinite loops, and test placement.
+ Exact rules: Cargo.toml. Do not enable contradictory restriction groups wholesale.
+
+ Workarounds preserve strictness:
+
+ Explicit checked Clap builders replace derives. Clap still parses all
+ arguments; no application shell parser. Both command schemas test modes,
+ required paths, listeners, global --root, and maintenance conflicts.
+ Help/rejected-option exit codes were compared with previous binaries.
+ Removed unused derive feature and its lockfile dependency.
+
+ Explicit checked Tokio runtime builder replaces runtime attribute.
+ Construction failures use existing error path; no broad generated
+ expect/style/complexity allowances remain.
+
+ Management/server implementations use private app namespaces and
+ pub(super), narrower than crate visibility. Re-export only documented
+ entry point at binary root. Enforce redundant_pub_crate/unreachable_pub
+ without exposing helpers or allowing either lint.
+
+ Serde containers set crate = "serde", avoiding generated extern-crate
+ branch and unused_extern_crates/clippy::useless_attribute allowances.
+ Preserve file/wire field names, ordering, tagging, unknown-field checks.
+
+ Result-returning tests use anyhow::ensure instead of panicking, permitting
+ panic_in_result_fn without suppressions.
THREE REMAINING RUST DENY SETTINGS
- unused, nonstandard_style, and unused_qualifications remain deny. This is
- a generated-code compatibility requirement, not permission to add source
- allowances. clippy::allow_attributes and allow_attributes_without_reason
- are forbidden for first-party source.
-
- The pinned Serde derive implementation unconditionally emits allowances for
- non_upper_case_globals, unused_attributes, unused_qualifications, and
- clippy::absolute_paths in serde_derive/src/dummy.rs. Its generated field
- identifier visitor also allows non_camel_case_types. These are generated
- attributes even when the first-party type has correct names and no redundant
- qualification. They cannot be removed by renaming fields or imports.
-
- The supported crate-path workaround was applied and all macros were inspected.
- Repeating Clippy with -F unused, -F nonstandard_style, or
- -F unused_qualifications still rejects the pinned Serde expansion. There is
- no supported derive setting to suppress that unconditional wrapper. Further
- changes would require forking the generator or replacing the serialization
- implementation, including security-sensitive identity/envelope/request formats.
- Those are explicit upstream/format migrations, not configuration fixes.
-
- Every other unused-group member and non_snake_case is independently forbidden.
- warnings itself is forbidden; the explicit deny groups provide the narrowly
- required effective levels for the generated attributes. No first-party
- allow/expect attributes were added.
+ unused, nonstandard_style, unused_qualifications stay deny for generated-code
+ compatibility, not permission for source allowances. First-party
+ clippy::allow_attributes and allow_attributes_without_reason are forbidden.
+
+ Pinned serde_derive/src/dummy.rs unconditionally allows non_upper_case_globals,
+ unused_attributes, unused_qualifications, clippy::absolute_paths. Generated
+ field-identifier visitor also allows non_camel_case_types. Correct first-party
+ names/qualifications cannot remove these generated attributes.
+
+ Applied supported crate-path workaround; inspected all macros. Clippy with
+ -F unused, -F nonstandard_style, or -F unused_qualifications still rejects
+ pinned Serde expansion. No supported derive setting removes its unconditional
+ wrapper. Further changes require a generator fork or serialization replacement,
+ including security-sensitive identity/envelope/request formats: explicit
+ upstream/format migrations, not configuration fixes.
+
+ Independently forbid every other unused member and non_snake_case. warnings
+ remains forbidden; explicit deny groups supply narrow effective levels needed
+ by generated attributes. Added no first-party allow/expect attributes.
DUPLICATE DEPENDENCIES
- clippy.toml restricts allowed-duplicate-crates to generic-array, getrandom,
- and syn: the names actually diagnosed in this workspace. The Clippy lint
- and cargo group remain forbidden for every other dependency.
+ clippy.toml allowed-duplicate-crates contains only diagnosed names:
+ generic-array, getrandom, syn. Lint/cargo group forbid all other duplicates.
+ Pinned crypto/parser/build graph needs incompatible semver lines:
- The incompatible lines come from the pinned crypto/parser/build graph:
generic-array 0.14.7 and 1.4.5
getrandom 0.2.17 and 0.4.3
syn 2.0.119 and 3.0.9
- These are different semver compatibility lines, not duplicate patch releases.
- Unifying them requires upstream API changes or older dependencies. No crypto
- algorithm/backend changes or dependency downgrades were made for a lint.
- cargo-deny continues to enforce its exact reviewed version exceptions in
- deny.toml, including build/development dependencies. Clippy's name-only
- configuration does not replace that stronger version-specific audit.
+ These are not duplicate patch releases. Unification needs upstream API changes
+ or older dependencies. No crypto/backend changes or downgrades for lint.
+ cargo-deny enforces exact reviewed deny.toml exceptions, including build/dev
+ dependencies. Clippy's name-only allowance cannot replace that stronger audit.
TYPESCRIPT
- The compiler checks strict mode and the additional indexed access, optional
- property, unused, return, switch, override, and import checks. noCheck and
- allowJs are explicitly false. Both declaration-library skip flags are false.
- isolatedModules, erasableSyntaxOnly, and verbatimModuleSyntax remain enabled.
- Browser/worker configurations use Bundler resolution with Preserve output;
- they contain no runtime imports. Tests and tooling use NodeNext separately.
-
- eslint.config.ts extends the typed strict and stylistic TypeScript presets.
- All diagnostics are errors and any warning fails the check. Inline config
- is disabled; suppression directives and unsafe assertions are prohibited.
- Additional rules reject ambiguous boolean coercion, unhandled/misused promises,
- explicit or leaked any, non-null assertions, unsafe calls/returns/arguments,
- eval, unsafe casts, and unchecked discriminated-union switches. Functions
- expose checked return types; callback contexts retain their declared contracts.
-
- UI async tasks now have explicit rejection handlers at the DOM boundary.
- Test HTTP handlers also catch rejected work rather than returning unobserved
- promises to Node. WASI validates its start export before calling it, and the
- shared host is installed as a frozen, non-writable global property. Dynamic
- JSON and worker boundaries still validate unknown values at runtime.
-
- TypeScript 7.0.2 remains the emitting compiler, installed under the explicit
- typescript-native npm alias. typescript-eslint 8.72.1 supports TypeScript
- >=4.8.4 <6.1.0 and requires the JavaScript compiler API, so TypeScript 6.0.3
- supplies that supported lint API. Sources are checked by both compilers;
- no unsupported-peer or ignore-peer-dependency install flags are used.
- Every invocation names the intended compiler path to avoid npm bin collisions.
-
- Isolated declaration emission is a library-distribution constraint, not an
- additional application safety check. This project serves classic scripts
- for the tested LibreJS path and does not publish a TypeScript library.
- moduleDetection=force is used for tests/tools; changing browser scripts to
- ESM solely for that setting would change their loading/LibreJS contract.
- TypeScript 7 removed allowSyntheticDefaultImports=false, so that obsolete
- switch is not used. Typed linting checks unsafe interop at use sites.
+ Check strict mode, indexed access, optional properties, unused, returns,
+ switches, overrides, imports. Explicitly disable noCheck/allowJs and both
+ declaration-library skip flags. Enable isolatedModules, erasableSyntaxOnly,
+ verbatimModuleSyntax. Browser/worker: Bundler resolution, Preserve output,
+ no runtime imports. Tests/tools: separate NodeNext configurations.
+
+ eslint.config.ts extends typed strict/stylistic presets. All diagnostics are
+ errors; warnings fail. Disable inline config; prohibit suppression directives
+ and unsafe assertions. Reject ambiguous boolean coercion, unhandled/misused
+ promises, explicit/leaked any, non-null assertions, unsafe calls/returns/
+ arguments, eval, unsafe casts, unchecked discriminated-union switches.
+ Functions expose checked return types; callbacks retain declared contracts.
+
+ DOM async tasks and test HTTP handlers catch rejections; Node receives no
+ unobserved promises. WASI validates start export before calling it. Shared
+ host is a frozen, non-writable global. JSON/worker boundaries validate unknown
+ values at runtime.
+
+ TypeScript 7.0.2 emits through explicit typescript-native npm alias.
+ typescript-eslint 8.72.1 supports >=4.8.4 <6.1.0 and requires JavaScript
+ compiler API; TypeScript 6.0.3 supplies it. Both compilers check sources.
+ No unsupported-peer/ignore-peer-dependency install flags. Name intended
+ compiler path in every invocation to avoid npm bin collisions.
+
+ Isolated declaration emission constrains library distribution, not application
+ safety. This app publishes no TypeScript library; classic scripts preserve
+ tested LibreJS loading. moduleDetection=force applies to tests/tools. Do not
+ change browser scripts to ESM solely for that setting. TypeScript 7 removed
+ allowSyntheticDefaultImports=false; omit obsolete switch. Typed lint checks
+ unsafe interop at use sites.
DEVELOPMENT DEPENDENCY ADVISORY
- ESLint and typescript-eslint currently request minimatch 10. The public
- GHSA-g3hv-75wg-m249 advisory affects minimatch <11.0.1. The root npm override
- pins the patched 11.0.3 release instead of ignoring the advisory or applying
- npm audit fix --force. Its supported exports and Node engine were reviewed;
- typed linting and rule-selection/negative-control checks exercise compatibility.
- Remove the override when upstream ranges admit a patched version naturally.
+ ESLint/typescript-eslint request minimatch 10. GHSA-g3hv-75wg-m249 affects
+ minimatch <11.0.1. Root npm override pins patched 11.0.3; no advisory ignore
+ or npm audit fix --force. Reviewed exports/Node engine; typed lint and rule-
+ selection/negative-control checks exercise compatibility. Remove override
+ when upstream ranges naturally admit a patched version.
- npm audit --audit-level=info is part of npm run check and therefore the Cargo
- check/release path. Development dependency findings fail the build too.
- Installed tools preserve their original notices and machine SPDX identifiers.
- Human documentation calls SPDX MIT the Expat License. No third-party
- JavaScript dependency is delivered to visitors.
+ npm audit --audit-level=info runs in npm run check and Cargo check/release.
+ Development findings fail too. Tools retain original notices/machine SPDX.
+ Human docs call MIT the Expat License. Visitors receive no third-party JS.
CHECKS AND EXPORTS
@@ -169,15 +145,14 @@ CHECKS AND EXPORTS
cargo stack check
cargo stack release
- The first checks both TypeScript compilers, typed ESLint, and npm advisories,
- then emits the browser/worker/test artifacts. Cargo also runs formatting,
- strict Clippy, all workspace tests, strict Rustdoc, cargo-deny, and cargo-about.
- Browser checks and GNU LibreJS controls are documented in TYPESCRIPT.txt.
+ npm build checks both compilers, typed ESLint, npm advisories; emits browser/
+ worker/test artifacts. Cargo adds formatting, strict Clippy, all workspace
+ tests, strict Rustdoc, cargo-deny, cargo-about. Browser/LibreJS controls:
+ TYPESCRIPT.txt.
- clippy.toml, eslint.config.ts, every tsconfig, and both lockfiles are included
- in corresponding sources, releases, and backups. Installed node_modules,
- runtime state, and the private .env remain outside public exports. Nothing
- introduces another deployment environment file or a production Node runtime.
+ Corresponding sources/releases/backups include clippy.toml, eslint.config.ts,
+ every tsconfig, both lockfiles. Public exports exclude installed node_modules,
+ runtime state, private .env. No extra deployment env file or production Node.
PRIMARY REFERENCES