Add internal hidden rules for testing (#9747)

Updated implementation of https://github.com/astral-sh/ruff/pull/7369
which was left out in the cold.

This was motivated again following changes in #9691 and #9689 where we
could not test the changes without actually deprecating or removing
rules.

---

Follow-up to discussion in https://github.com/astral-sh/ruff/pull/7210

Moves integration tests from using rules that are transitively in
nursery / preview groups to dedicated test rules that only exist during
development. These rules always raise violations (they do not require
specific file behavior). The rules are not available in production or in
the documentation.

Uses features instead of `cfg(test)` for cross-crate support per
https://github.com/rust-lang/cargo/issues/8379
This commit is contained in:
Zanie Blue 2024-02-01 08:44:51 -06:00 committed by GitHub
parent 2cc8acb0b7
commit f18e7d40ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 541 additions and 196 deletions

View file

@ -206,6 +206,9 @@ class CheckOptions(CommandOptions):
"check",
"--no-cache",
"--exit-zero",
# Ignore internal test rules
"--ignore",
"RUF9",
f"--{'' if self.preview else 'no-'}preview",
]
if self.select: