mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-12 14:48:16 +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
|
@ -183,17 +183,17 @@ mod tests {
|
|||
/// Very basic test intentionally kept very similar to the CLI
|
||||
#[test]
|
||||
fn basic() -> Result<()> {
|
||||
let input = r#"
|
||||
let input = r"
|
||||
# preceding
|
||||
if True:
|
||||
pass
|
||||
# trailing
|
||||
"#;
|
||||
let expected = r#"# preceding
|
||||
";
|
||||
let expected = r"# preceding
|
||||
if True:
|
||||
pass
|
||||
# trailing
|
||||
"#;
|
||||
";
|
||||
let actual = format_module_source(input, PyFormatOptions::default())?
|
||||
.as_code()
|
||||
.to_string();
|
||||
|
@ -241,11 +241,11 @@ def main() -> None:
|
|||
|
||||
assert_eq!(
|
||||
printed.as_code(),
|
||||
r#"for converter in connection.ops.get_db_converters(
|
||||
r"for converter in connection.ops.get_db_converters(
|
||||
expression
|
||||
) + expression.get_db_converters(connection):
|
||||
...
|
||||
"#
|
||||
"
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -304,9 +304,9 @@ def main() -> None:
|
|||
|
||||
// 77 after g group (leading quote)
|
||||
let fits =
|
||||
r#"aaaaaaaaaa bbbbbbbbbb cccccccccc dddddddddd eeeeeeeeee ffffffffff gggggggggg h"#;
|
||||
r"aaaaaaaaaa bbbbbbbbbb cccccccccc dddddddddd eeeeeeeeee ffffffffff gggggggggg h";
|
||||
let breaks =
|
||||
r#"aaaaaaaaaa bbbbbbbbbb cccccccccc dddddddddd eeeeeeeeee ffffffffff gggggggggg hh"#;
|
||||
r"aaaaaaaaaa bbbbbbbbbb cccccccccc dddddddddd eeeeeeeeee ffffffffff gggggggggg hh";
|
||||
|
||||
let output = format!(
|
||||
SimpleFormatContext::default(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue