From a071114638931bdca7c0c324fa1512c293ec2f12 Mon Sep 17 00:00:00 2001 From: dylwil3 Date: Fri, 6 Jun 2025 09:26:59 -0500 Subject: [PATCH] remove preview check for rule --- crates/ruff_linter/src/checkers/ast/mod.rs | 20 ++++++++------------ crates/ruff_linter/src/preview.rs | 5 ----- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/crates/ruff_linter/src/checkers/ast/mod.rs b/crates/ruff_linter/src/checkers/ast/mod.rs index 3ca0b6ed5b..c1cc8a72a4 100644 --- a/crates/ruff_linter/src/checkers/ast/mod.rs +++ b/crates/ruff_linter/src/checkers/ast/mod.rs @@ -65,7 +65,7 @@ use crate::docstrings::extraction::ExtractionTarget; use crate::importer::{ImportRequest, Importer, ResolutionError}; use crate::noqa::NoqaMapping; use crate::package::PackageRoot; -use crate::preview::{is_semantic_errors_enabled, is_undefined_export_in_dunder_init_enabled}; +use crate::preview::is_semantic_errors_enabled; use crate::registry::{AsRule, Rule}; use crate::rules::pyflakes::rules::{ LateFutureImport, ReturnOutsideFunction, YieldOutsideFunction, @@ -2900,17 +2900,13 @@ impl<'a> Checker<'a> { } } else { if self.enabled(Rule::UndefinedExport) { - if is_undefined_export_in_dunder_init_enabled(self.settings) - || !self.path.ends_with("__init__.py") - { - self.report_diagnostic( - pyflakes::rules::UndefinedExport { - name: name.to_string(), - }, - range, - ) - .set_parent(definition.start()); - } + self.report_diagnostic( + pyflakes::rules::UndefinedExport { + name: name.to_string(), + }, + range, + ) + .set_parent(definition.start()); } } } diff --git a/crates/ruff_linter/src/preview.rs b/crates/ruff_linter/src/preview.rs index 50b4fac603..acd80e4ca0 100644 --- a/crates/ruff_linter/src/preview.rs +++ b/crates/ruff_linter/src/preview.rs @@ -111,11 +111,6 @@ pub(crate) const fn is_support_slices_in_literal_concatenation_enabled( settings.preview.is_enabled() } -// https://github.com/astral-sh/ruff/pull/11370 -pub(crate) const fn is_undefined_export_in_dunder_init_enabled(settings: &LinterSettings) -> bool { - settings.preview.is_enabled() -} - // https://github.com/astral-sh/ruff/pull/14236 pub(crate) const fn is_allow_nested_roots_enabled(settings: &LinterSettings) -> bool { settings.preview.is_enabled()