mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 22:01:47 +00:00
Remove result_like
dependency (#11793)
## Summary This PR removes the `result-like` dependency and instead implement the required functionality. The motivation being that `noqa.is_enabled()` is easier to read than `noqa.into()`. For context, I was just trying to understand the syntax error workflow and I saw these flags which were being converted via `into`. I always find `into` confusing because you never know what's it being converted into unless you know the type. Later realized that it's just a boolean flag. After removing the usages from these two flags, it turns out that the dependency is only being used in one rule so I thought to remove that as well. ## Test Plan `cargo insta test`
This commit is contained in:
parent
ea27445479
commit
d22f3402e1
9 changed files with 60 additions and 57 deletions
|
@ -299,7 +299,7 @@ pub fn check_path(
|
|||
}
|
||||
|
||||
// Enforce `noqa` directives.
|
||||
if (noqa.into() && !diagnostics.is_empty())
|
||||
if (noqa.is_enabled() && !diagnostics.is_empty())
|
||||
|| settings
|
||||
.rules
|
||||
.iter_enabled()
|
||||
|
@ -315,7 +315,7 @@ pub fn check_path(
|
|||
&per_file_ignores,
|
||||
settings,
|
||||
);
|
||||
if noqa.into() {
|
||||
if noqa.is_enabled() {
|
||||
for index in ignored.iter().rev() {
|
||||
diagnostics.swap_remove(*index);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue