Skip to content

Commit

Permalink
error message nits
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWaygood committed Nov 21, 2024
1 parent fbcfdad commit 14ad456
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions crates/ruff/tests/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 -----
Expand All @@ -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(())
}

Expand All @@ -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 -----
Expand All @@ -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(())
}
4 changes: 2 additions & 2 deletions crates/ruff_workspace/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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",
))
}
}
Expand Down

0 comments on commit 14ad456

Please sign in to comment.