chant workspace lint
Synopsis
Section titled “Synopsis”chant workspace lint [dir] [--format stylish|json|sarif] [-o <file>] [--member <name>] [--fix] [--dry-run [--json]]Description
Section titled “Description”chant workspace lint runs chant lint . inside every member of kind chant and every project an example group matches, each under the member’s own chant (#2537, ws-026). Each member is linted with the rules and lexicon versions it would use on its own. The members to run, the toolchain each one gets and the one process per toolchain work as described for chant workspace build.
The root member . is linted without the other members’ directories and the group matches, as chant lint --root-only lints it.
Output
Section titled “Output”With the default stylish format, each project’s own lint output is printed under a heading, and a summary line goes to stderr.
With --format sarif, the output is one SARIF 2.1.0 log with one run per member. Each run is what the member’s chant lint --format sarif printed, with three changes:
automationDetails.idis<member>/, or<group>:<dir>/for an example project, which is how SARIF tells runs of one tool apart. GitHub code scanning shows it as the category.propertiesgainsmemberanddir.- Artifact URIs are made relative to the workspace root.
A member whose lint printed no SARIF gets a run with no results and a failed invocation carrying its exit code and the end of its stderr.
{ "version": "2.1.0", "runs": [ { "tool": { "driver": { "name": "chant", "rules": [] } }, "automationDetails": { "id": "api/" }, "properties": { "member": "api", "dir": "services/api" }, "results": [ { "ruleId": "COR004", "locations": [{ "physicalLocation": { "artifactLocation": { "uri": "services/api/src/infra.ts" } } }] } ] } ]}With --format json, the output is { "workspace", "members", "skipped" }. Each entry in members names the member and its directory, and holds the member’s exit code and the diagnostics array its own chant lint --format json printed.
Options
Section titled “Options”| Option | Effect |
|---|---|
dir | Where the walk up to the declaration starts. |
--format stylish|json|sarif | The output format, and the format each member is asked for. |
-o, --output <file> | Write the json or sarif document to a file. |
--member <name> | Run only these members or example groups. Repeatable, and a comma list works too. |
--fix, --param <name=value>, --params-file <path> | Passed to each member’s lint. |
--dry-run | Print the plan and lint nothing. |
Exit codes
Section titled “Exit codes”| Code | Meaning |
|---|---|
| 0 | No project’s lint found errors. |
| 1 | A project’s lint found errors or failed, a chant member couldn’t be read, or the declaration couldn’t be read. |
Examples
Section titled “Examples”# Lint every member and example projectchant workspace lint
# One SARIF log for code scanning, one run per memberchant workspace lint --format sarif -o results.sarif