mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 22:31:23 +00:00
Port from obsolete wsl crate to is-wsl (#9356)
The "wsl" crate was last touched in 2019, whereas the "is-wsl" crate was last updated in 2023. Additionally, it is unclear whether the "wsl" crate supports both WSL1 and WSL2 (which was announced in 2019), whereas the "is-wsl" crate explicitly supports both WSL1 and WSL2. The required code changes are minimal, since both crates provide only a `is_wsl() -> bool` function.
This commit is contained in:
parent
8db5bce92f
commit
1f4dc12631
5 changed files with 24 additions and 13 deletions
|
@ -41,6 +41,7 @@ glob = { workspace = true }
|
|||
globset = { workspace = true }
|
||||
imperative = { version = "1.0.4" }
|
||||
is-macro = { workspace = true }
|
||||
is-wsl = { workspace = true }
|
||||
itertools = { workspace = true }
|
||||
libcst = { workspace = true }
|
||||
log = { workspace = true }
|
||||
|
@ -72,7 +73,6 @@ typed-arena = { version = "2.0.2" }
|
|||
unicode-width = { workspace = true }
|
||||
unicode_names2 = { workspace = true }
|
||||
url = { version = "2.2.2" }
|
||||
wsl = { version = "0.1.0" }
|
||||
|
||||
[dev-dependencies]
|
||||
insta = { workspace = true }
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
use std::path::Path;
|
||||
|
||||
use ruff_text_size::{Ranged, TextRange};
|
||||
use wsl;
|
||||
|
||||
use ruff_diagnostics::{Diagnostic, Violation};
|
||||
use ruff_macros::{derive_message_formats, violation};
|
||||
|
@ -45,7 +44,7 @@ impl Violation for ShebangMissingExecutableFile {
|
|||
pub(crate) fn shebang_missing_executable_file(filepath: &Path) -> Option<Diagnostic> {
|
||||
// WSL supports Windows file systems, which do not have executable bits.
|
||||
// Instead, everything is executable. Therefore, we skip this rule on WSL.
|
||||
if wsl::is_wsl() {
|
||||
if is_wsl::is_wsl() {
|
||||
return None;
|
||||
}
|
||||
if let Ok(true) = is_executable(filepath) {
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
use std::path::Path;
|
||||
|
||||
use ruff_text_size::{Ranged, TextRange};
|
||||
use wsl;
|
||||
|
||||
use ruff_diagnostics::{Diagnostic, Violation};
|
||||
use ruff_macros::{derive_message_formats, violation};
|
||||
|
@ -45,7 +44,7 @@ impl Violation for ShebangNotExecutable {
|
|||
pub(crate) fn shebang_not_executable(filepath: &Path, range: TextRange) -> Option<Diagnostic> {
|
||||
// WSL supports Windows file systems, which do not have executable bits.
|
||||
// Instead, everything is executable. Therefore, we skip this rule on WSL.
|
||||
if wsl::is_wsl() {
|
||||
if is_wsl::is_wsl() {
|
||||
return None;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue