Repository navigation
feat(rules): route-literals keeps HTTP paths in the modules standard.toml lists - #32
Draft
PiquelChips wants to merge 1 commit into
Draft
PiquelChips wants to merge 1 commit into
PiquelChips wants to merge 1 commit into
Conversation
3 tasks done
PiquelChips
force-pushed
the
feat/rule-no-json-macro
branch
from
November 22, 2026 22:17
72accb6 to
d00bbc9
Compare
When route-modules lists modules, code outside them, tests and examples passes no /… literal to Router::route, route_service, nest or nest_service, or to a Redirect constructor. The module walk now records whether each file is production, test or example code to the targets reaching it.
PiquelChips
force-pushed
the
feat/rule-route-literals
branch
from
November 22, 2026 22:18
8cc9f86 to
dafb8fa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
In sourceorigin,
routes.rsowns the HTTP paths that routers, discovery, redirects and policy use (SO4). A path written inline in a router can drift from the one discovery or a redirect advertises.route-literalsfails on a string literal starting with/passed toRouter::route,route_service,nestornest_service, or to aRedirectconstructor (Redirect::to,see_other, …). It skips test code, examples and the modulesstandard.tomllists:route-modules, nothing is checked, since the rule is sourceorigin's.my_app::routes::admin), by the module paths the base's walk gives each file;inline-limits(feat(rules): inline-limits makes Durations with literals named constants #30) defines it;string_literal_logicdoesn't cover this. It flags literals compared or matched (==,match,starts_with), not literals passed as arguments, so.route("/settings", …)passes it.--fix: naming the path takes judgement.Stacked on #31.
Testing
just check-changed feat/rule-no-json-macropasses, and re-measuring gives the counts below again..route("/settings"),.nest("/api")andRedirect::to("/signed-out")fail.routes::HOME, an absolute URL, a#[test], the listedapp::routesand its child, and an example.app::pathsfails at its line.route-modules, nothing is checked.Measured on a
git archivecopy of sourceorigin'sorigin/main(e99cc0e6b, since removed):route-modules["auth_service::routes"]/login,/callback,/logout,/backchannel-logout(auth-sdk/src/axum/login/mod.rs); itslogin/routes.rsholds handlers, not paths["auth_service::routes", "sourceorigin_auth::axum::login"]auth-service already routes only through
routes::constants. Its 41 inline.route("/…")calls are all in tests, examples and doc comments. piqueld (3 literals inapi/http/mod.rs) and DirkEngine don't opt in.Checklist
just readme, androute-modulesin the configuration example.)Rulevariant andstandard.tomlkey; no xtask change.)just check-changedpasses.Note
Written by Claude Opus 5.5 in Claude Code (via T3 Code)