Skip to content

Commit

Permalink
feat(AIR303): initial air303
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee-W committed Dec 4, 2024
1 parent edce559 commit b1eb36b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/ruff_linter/src/checkers/ast/analyze/expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ pub(crate) fn expression(expr: &Expr, checker: &mut Checker) {
if checker.enabled(Rule::Airflow3Removal) {
airflow::rules::removed_in_3(checker, expr);
}
if checker.enabled(Rule::Airflow3Removal) {
airflow::rules::moved_to_provider_in_3(checker, expr);
}

// Ex) List[...]
if checker.any_enabled(&[
Expand Down
13 changes: 13 additions & 0 deletions crates/ruff_linter/src/rules/airflow/rules/removal_in_3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,16 @@ pub(crate) fn removed_in_3(checker: &mut Checker, expr: &Expr) {
_ => {}
}
}

/// AIR303
pub(crate) fn moved_to_provider_in_3(checker: &mut Checker, expr: &Expr) {
if !checker.semantic().seen_module(Modules::AIRFLOW) {
return;
}

match expr {
Expr::Attribute(ExprAttribute { attr: ranged, .. }) => removed_name(checker, expr, ranged),
ranged @ Expr::Name(_) => removed_name(checker, expr, ranged),
_ => {}
}
}

0 comments on commit b1eb36b

Please sign in to comment.