feature: List lints#21
Merged
Merged
Conversation
Signed-off-by: Mauro Lacy <11656534+maurolacy@users.noreply.github.com>
maurolacy
force-pushed
the
feature/lints-list
branch
from
July 7, 2026 11:01
81552e9 to
18fd89e
Compare
There was a problem hiding this comment.
Pull request overview
Adds a --list mode to cargo gears lint so users can discover available lint suites and embedded dylint rules without running checks (and without needing a manifest/workspace path in list mode).
Changes:
- Add
--listflag to the CLI lint command and short-circuit resolution when enabled. - Add a dylint rule registry (
DYLINT_LINTS) and a printer in core lint logic. - Document the new flag and behavior in
SKILL.md.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| crates/cargo-gears/src/lint.rs | Adds --list flag, list-mode short-circuit in resolve, and CLI-level tests. |
| crates/cargo-gears-core/src/lint/mod.rs | Adds list support to LintParams::run(), plus embedded dylint lint metadata and list output. |
| crates/cargo-gears-core/shared/SKILL.md | Updates CLI documentation and examples for the new --list flag. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+42
to
+46
| fmt: false, | ||
| clippy: false, | ||
| strict: false, | ||
| dylint: self.dylint || self.all, | ||
| dylint_skip: Vec::new(), |
Comment on lines
+249
to
+257
| #[test] | ||
| fn list_without_dylint_sets_dylint_false() { | ||
| let cli = TestCli::try_parse_from(["gears", "--app", "a", "--env", "e", "--list"]) | ||
| .expect("should parse"); | ||
| let resolved = cli.lint.resolve().expect("resolve"); | ||
|
|
||
| assert!(resolved.list); | ||
| assert!(!resolved.dylint); | ||
| } |
Comment on lines
36
to
+40
| pub dylint: bool, | ||
| /// Lint names to skip when running dylint. | ||
| pub dylint_skip: Vec<String>, | ||
| /// List available lints instead of running them. | ||
| pub list: bool, |
Bechma
approved these changes
Jul 7, 2026
Bechma
left a comment
Owner
There was a problem hiding this comment.
Approved but with a warning, we need to improve this logic for the future, as we have the lints built in, inside of the binary, we should be able to introspect them.
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.
Add a
--listflag tocargo gears lint.Closes / after constructorfabric/gears-rust#4183 (comment).