mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-16 00:20:38 +00:00
Update to Rust 1.74 and use new clippy lints table (#8722)
Update to [Rust 1.74](https://blog.rust-lang.org/2023/11/16/Rust-1.74.0.html) and use the new clippy lints table. The update itself introduced a new clippy lint about superfluous hashes in raw strings, which got removed. I moved our lint config from `rustflags` to the newly stabilized [workspace.lints](https://doc.rust-lang.org/stable/cargo/reference/workspaces.html#the-lints-table). One consequence is that we have to `unsafe_code = "warn"` instead of "forbid" because the latter now actually bans unsafe code: ``` error[E0453]: allow(unsafe_code) incompatible with previous forbid --> crates/ruff_source_file/src/newlines.rs:62:17 | 62 | #[allow(unsafe_code)] | ^^^^^^^^^^^ overruled by previous forbid | = note: `forbid` lint level was set on command line ``` --------- Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
This commit is contained in:
parent
6d5d079a18
commit
14e65afdc6
71 changed files with 1124 additions and 1054 deletions
|
@ -169,21 +169,21 @@ mod tests {
|
|||
#[test]
|
||||
|
||||
fn deserialize() -> Result<()> {
|
||||
let pyproject: Pyproject = toml::from_str(r#""#)?;
|
||||
let pyproject: Pyproject = toml::from_str(r"")?;
|
||||
assert_eq!(pyproject.tool, None);
|
||||
|
||||
let pyproject: Pyproject = toml::from_str(
|
||||
r#"
|
||||
r"
|
||||
[tool.black]
|
||||
"#,
|
||||
",
|
||||
)?;
|
||||
assert_eq!(pyproject.tool, Some(Tools { ruff: None }));
|
||||
|
||||
let pyproject: Pyproject = toml::from_str(
|
||||
r#"
|
||||
r"
|
||||
[tool.black]
|
||||
[tool.ruff]
|
||||
"#,
|
||||
",
|
||||
)?;
|
||||
assert_eq!(
|
||||
pyproject.tool,
|
||||
|
@ -193,11 +193,11 @@ mod tests {
|
|||
);
|
||||
|
||||
let pyproject: Pyproject = toml::from_str(
|
||||
r#"
|
||||
r"
|
||||
[tool.black]
|
||||
[tool.ruff]
|
||||
line-length = 79
|
||||
"#,
|
||||
",
|
||||
)?;
|
||||
assert_eq!(
|
||||
pyproject.tool,
|
||||
|
@ -275,11 +275,11 @@ ignore = ["E501"]
|
|||
);
|
||||
|
||||
assert!(toml::from_str::<Pyproject>(
|
||||
r#"
|
||||
r"
|
||||
[tool.black]
|
||||
[tool.ruff]
|
||||
line_length = 79
|
||||
"#,
|
||||
",
|
||||
)
|
||||
.is_err());
|
||||
|
||||
|
@ -293,12 +293,12 @@ select = ["E123"]
|
|||
.is_err());
|
||||
|
||||
assert!(toml::from_str::<Pyproject>(
|
||||
r#"
|
||||
r"
|
||||
[tool.black]
|
||||
[tool.ruff]
|
||||
line-length = 79
|
||||
other-attribute = 1
|
||||
"#,
|
||||
",
|
||||
)
|
||||
.is_err());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue