Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Identify rust-toolchain files as rust-toolchain #459

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jalaziz
Copy link
Contributor

@jalaziz jalaziz commented May 12, 2024

Introduce dedicated types for rust-toolchain and rust-toolchain.toml files. Cargo linting rules can change with the rust version, so it's helpful to match against the rust-toolchain files as a trigger for Rust linting hooks.

Introduce dedicated types for rust-toolchain and rust-toolchain.toml
files. Cargo linting rules can change with the rust version, so it's
helpful to match against the rust-toolchain files as a trigger for Rust
linting hooks.
@asottile
Copy link
Member

same feedback as your other PR: #460 (comment)

@jalaziz
Copy link
Contributor Author

jalaziz commented May 30, 2024

same feedback as your other PR: #460 (comment)

Yes, filtering by files can accomplishes the same things, but it's impossible to combine files and types with OR.

The docs encourage using types with:

Filtering with types provides several advantages over traditional filtering with files.

  • no error-prone regular expressions
  • files can be matched by their shebang (even when extensionless)
  • symlinks / submodules can be easily ignored

Which encourages the use of types like rust, cargo, etc.

However, due to:

types, types_or, and files are evaluated together with AND when filtering. Tags within types are also evaluated using AND.

You can't mix and match types_or and files without including the for matching types in files.

Since Rust linting rules change with new versions of cargo (usually released alongside new versions of Rust), this is needed to avoid having to completely devolve into using files instead of types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants