Skip to main content

Module lint

Module lint 

Source
Expand description

lint: everything wrong with the shape of the game’s code, in one answer, each finding with its file, its line and what to do (ADR-0005 §1):

  • check-keys’ findings: a key named in the game’s code or text (crate::check_keys, codes::HARD_CODED_KEY);
  • check-text’s: screen text written as literals, when there are more than the project allows, and a data name read by a screen (crate::check_text, codes::SCREEN_TEXT);
  • the rules crate’s fence (ADR-0032 §4): cargo clippy on the package shuyi.ron’s rules names, read for the lints its clippy.toml and its lib.rs set, a hash map, a float, a clock, file I/O or outside luck (FENCE_LINTS, codes::RULES_FENCE);
  • its layers: cargo tree of that package, as the template’s tests/layers.rs reads it, each crate the rules never depend on (NEVER, codes::RULES_DEPENDENCY) with the cargo tree -i that shows the way in.

The two checks run in this process; clippy and cargo tree run as child processes from the project’s root, through a Cargo, so the tests can give any output. What isn’t checked (a part shuyi.ron lacks, a cargo that fails) is in the answer’s limits. It passes when nothing is found.

Structs§

Finding
One thing wrong, with where.
LintInput
What lint checks: everything (nothing to choose yet).
LintOutput
What lint found.
Ran
What cargo printed and whether it succeeded.
ThisMachine
The machine’s cargo: the one running this program if cargo started it (CARGO), else cargo on the PATH.

Enums§

LintCheck
Which check found a finding.

Constants§

FENCE_LINTS
The clippy lints of the rules crate’s fence.
NEVER
The crates the rules never depend on, even through another crate, as the template’s grid stage’s crates/rules/tests/layers.rs lists them (a test keeps the two the same). A trailing * is a prefix.

Traits§

Cargo
How lint runs cargo.

Functions§

clippy_findings
The fence’s findings in clippy’s JSON output, stdout (cargo’s --message-format=json), files shown from root: each message of a lint of FENCE_LINTS, once, its reason after it. Any other lint is left out.
lint
lint on project, running cargo with cargo.
reported
A finding of check from a line a check reports (file:line: what, or file: what), with code; one that couldn’t read a file has codes::FILE.
text
What lint found, for people.
tree_findings
The layers’ findings in cargo tree -p package --prefix none --format {p}’s output, stdout: each crate of NEVER in it, once, in the package’s Cargo.toml (from root, read off the tree’s first line), with the cargo tree -i that shows the way in.
usage
lint’s usage, with command as the tool’s name.