From 8726e6ee63822208ae599e1f46fd9d95c47a3a11 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Thu, 27 Jun 2024 14:53:12 -0400 Subject: [PATCH] Bump max iterations to 12 --- ...__tests__numpy2-deprecation_NPY201.py.snap | 26 +++++++++++++++++++ crates/ruff_linter/src/test.rs | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/crates/ruff_linter/src/rules/numpy/snapshots/ruff_linter__rules__numpy__tests__numpy2-deprecation_NPY201.py.snap b/crates/ruff_linter/src/rules/numpy/snapshots/ruff_linter__rules__numpy__tests__numpy2-deprecation_NPY201.py.snap index 3bf5cc6600ff6..0bfd1fbf08ac5 100644 --- a/crates/ruff_linter/src/rules/numpy/snapshots/ruff_linter__rules__numpy__tests__numpy2-deprecation_NPY201.py.snap +++ b/crates/ruff_linter/src/rules/numpy/snapshots/ruff_linter__rules__numpy__tests__numpy2-deprecation_NPY201.py.snap @@ -998,6 +998,7 @@ NPY201.py:122:5: NPY201 [*] `np.AxisError` will be removed in NumPy 2.0. Use `nu 123 |+ AxisError 123 124 | 124 125 | np.ComplexWarning +125 126 | NPY201.py:124:5: NPY201 [*] `np.ComplexWarning` will be removed in NumPy 2.0. Use `numpy.exceptions.ComplexWarning` instead. | @@ -1005,6 +1006,8 @@ NPY201.py:124:5: NPY201 [*] `np.ComplexWarning` will be removed in NumPy 2.0. Us 123 | 124 | np.ComplexWarning | ^^^^^^^^^^^^^^^^^ NPY201 +125 | +126 | np.compare_chararrays | = help: Replace with `numpy.exceptions.ComplexWarning` @@ -1019,3 +1022,26 @@ NPY201.py:124:5: NPY201 [*] `np.ComplexWarning` will be removed in NumPy 2.0. Us 123 124 | 124 |- np.ComplexWarning 125 |+ ComplexWarning +125 126 | +126 127 | np.compare_chararrays + +NPY201.py:126:5: NPY201 [*] `np.compare_chararrays` will be removed in NumPy 2.0. Use `numpy.char.compare_chararrays` instead. + | +124 | np.ComplexWarning +125 | +126 | np.compare_chararrays + | ^^^^^^^^^^^^^^^^^^^^^ NPY201 + | + = help: Replace with `numpy.char.compare_chararrays` + +ℹ Safe fix + 1 |+from numpy.char import compare_chararrays +1 2 | def func(): +2 3 | import numpy as np +3 4 | +-------------------------------------------------------------------------------- +123 124 | +124 125 | np.ComplexWarning +125 126 | +126 |- np.compare_chararrays + 127 |+ compare_chararrays diff --git a/crates/ruff_linter/src/test.rs b/crates/ruff_linter/src/test.rs index 31fae2bdaa887..053fb273b092b 100644 --- a/crates/ruff_linter/src/test.rs +++ b/crates/ruff_linter/src/test.rs @@ -90,7 +90,7 @@ pub fn test_snippet(contents: &str, settings: &LinterSettings) -> Vec { } thread_local! { - static MAX_ITERATIONS: std::cell::Cell = const { std::cell::Cell::new(10) }; + static MAX_ITERATIONS: std::cell::Cell = const { std::cell::Cell::new(12) }; } pub fn set_max_iterations(max: usize) {