diff --git a/crates/ruff/tests/lint.rs b/crates/ruff/tests/lint.rs index f5f8013126a77..8c7ae672d8002 100644 --- a/crates/ruff/tests/lint.rs +++ b/crates/ruff/tests/lint.rs @@ -1986,7 +1986,7 @@ fn flake8_import_convention_invalid_aliases_config_alias_name() -> Result<()> { .args(STDIN_BASE_OPTIONS) .arg("--config") .arg(&ruff_toml) - , @r#" + , @r###" success: false exit_code: 2 ----- stdout ----- @@ -1998,8 +1998,8 @@ fn flake8_import_convention_invalid_aliases_config_alias_name() -> Result<()> { | 2 | [lint.flake8-import-conventions.aliases] | ^^^^ - invalid value: string "invalid.alias", expected alias must be a valid identifier - "#);}); + invalid value: string "invalid.alias", expected a Python identifier + "###);}); Ok(()) } @@ -2022,7 +2022,7 @@ fn flake8_import_convention_invalid_aliases_config_module_name() -> Result<()> { .args(STDIN_BASE_OPTIONS) .arg("--config") .arg(&ruff_toml) - , @r#" + , @r###" success: false exit_code: 2 ----- stdout ----- @@ -2034,7 +2034,7 @@ fn flake8_import_convention_invalid_aliases_config_module_name() -> Result<()> { | 2 | [lint.flake8-import-conventions.aliases] | ^^^^ - invalid value: string "module..invalid", expected module must be a valid identifier separated by single periods - "#);}); + invalid value: string "module..invalid", expected a sequence of Python identifiers delimited by periods + "###);}); Ok(()) } diff --git a/crates/ruff_workspace/src/options.rs b/crates/ruff_workspace/src/options.rs index 41f91d52bb6f5..a3a31ac894abf 100644 --- a/crates/ruff_workspace/src/options.rs +++ b/crates/ruff_workspace/src/options.rs @@ -1391,7 +1391,7 @@ impl<'de> Deserialize<'de> for ModuleName { if name.is_empty() || name.split('.').any(|part| !is_identifier(part)) { Err(de::Error::invalid_value( de::Unexpected::Str(&name), - &"module must be a valid identifier separated by single periods", + &"a sequence of Python identifiers delimited by periods", )) } else { Ok(Self(name)) @@ -1420,7 +1420,7 @@ impl<'de> Deserialize<'de> for Alias { } else { Err(de::Error::invalid_value( de::Unexpected::Str(&name), - &"alias must be a valid identifier", + &"a Python identifier", )) } }