linter: Enable test-rules for test build (#11201)

This commit is contained in:
Micha Reiser 2024-04-30 08:06:47 +02:00 committed by GitHub
parent c391c8b6cb
commit 5561d445d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 20 additions and 20 deletions

View file

@ -33,7 +33,7 @@ use crate::message::Message;
use crate::noqa::add_noqa;
use crate::registry::{AsRule, Rule, RuleSet};
use crate::rules::pycodestyle;
#[cfg(feature = "test-rules")]
#[cfg(any(feature = "test-rules", test))]
use crate::rules::ruff::rules::test_rules::{self, TestRule, TEST_RULES};
use crate::settings::types::UnsafeFixes;
use crate::settings::{flags, LinterSettings};
@ -218,7 +218,7 @@ pub fn check_path(
}
// Raise violations for internal test rules
#[cfg(feature = "test-rules")]
#[cfg(any(feature = "test-rules", test))]
{
for test_rule in TEST_RULES {
if !settings.rules.enabled(*test_rule) {