Skip to content

feature: List lints#21

Merged
Bechma merged 1 commit into
devfrom
feature/lints-list
Jul 7, 2026
Merged

feature: List lints#21
Bechma merged 1 commit into
devfrom
feature/lints-list

Conversation

@maurolacy

Copy link
Copy Markdown
Collaborator

Add a --list flag to cargo gears lint.

Closes / after constructorfabric/gears-rust#4183 (comment).

Signed-off-by: Mauro Lacy <11656534+maurolacy@users.noreply.github.com>
@maurolacy
maurolacy force-pushed the feature/lints-list branch from 81552e9 to 18fd89e Compare July 7, 2026 11:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --list flag 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 Bechma left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Bechma
Bechma merged commit f738243 into dev Jul 7, 2026
1 check passed
@Bechma
Bechma deleted the feature/lints-list branch July 7, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants