Repository navigation
feat(rules): no-json-macro keeps json! out of the crates standard.toml lists - #31
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-inline-limits
branch
from
November 22, 2026 22:16
4a8fa5d to
f1f4399
Compare
Code outside tests in the crates no-json-macro lists invokes no json!, so tokens and protocol documents come from typed structs. Clippy's disallowed-macros can't exempt tests, which use json! freely.
PiquelChips
force-pushed
the
feat/rule-no-json-macro
branch
from
November 22, 2026 22:17
72accb6 to
d00bbc9
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
sourceorigin builds tokens and protocol documents from
sourceorigin-common's structs, neverjson!(DP15). Ajson!document has a shape no type checks, so a misspelled claim or field ships silently. Clippy'sdisallowed-macroscan't exempt tests, and sourceorigin's tests usejson!about 300 times.no-json-macrofails onjson!(any path, such asserde_json::json!) outside test code in the cratesstandard.tomllists:inline-limits(feat(rules): inline-limits makes Durations with literals named constants #30) defines: test attributes, testcfgs, the files they declare, integration tests.json!inside another macro's arguments, such asprintln!("{}", json!(…)).budget.--fix: the struct to serialize takes judgement.Stacked on #30.
Testing
just check-changed feat/rule-inline-limitspasses.json!in a function and insideprintln!fail, and its#[test]passes. An unlisted crate passes. A listed name that is no crate fails at its line instandard.toml.Measured on
git archivecopies of each repository'sorigin/main(since removed), withno-json-macrolisting every workspace crate to show the most it would flag:e99cc0e6bjson!;{ "error": "invalid_request" }in auth-sdk's logout route, and a form tag round-trip in auth-service's profile settingsa17710f52apps/piqueld; piqueld isn't bound by DP15 and lists nothing unless it opts in07e8ba44For sourceorigin, listing the crates DP15 names makes this a two-line cleanup.
Checklist
just readme, andno-json-macroin 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)