mirror of https://github.com/astral-sh/ruff
refactor: Move #![forbid(unsafe_code)] attributes up
What's forbidden is more important than which clippy lints are ignored and more important directives should come first.
This commit is contained in:
parent
63b4f60ba4
commit
2125d0bb54
|
|
@ -1,4 +1,5 @@
|
||||||
//! Utility to generate Ruff's `pyproject.toml` section from a Flake8 INI file.
|
//! Utility to generate Ruff's `pyproject.toml` section from a Flake8 INI file.
|
||||||
|
#![forbid(unsafe_code)]
|
||||||
#![allow(
|
#![allow(
|
||||||
clippy::collapsible_else_if,
|
clippy::collapsible_else_if,
|
||||||
clippy::collapsible_if,
|
clippy::collapsible_if,
|
||||||
|
|
@ -11,7 +12,6 @@
|
||||||
clippy::similar_names,
|
clippy::similar_names,
|
||||||
clippy::too_many_lines
|
clippy::too_many_lines
|
||||||
)]
|
)]
|
||||||
#![forbid(unsafe_code)]
|
|
||||||
|
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
//! to automatically update the `ruff --help` output in the `README.md`.
|
//! to automatically update the `ruff --help` output in the `README.md`.
|
||||||
//!
|
//!
|
||||||
//! For the actual Ruff library, see [`ruff`].
|
//! For the actual Ruff library, see [`ruff`].
|
||||||
|
#![forbid(unsafe_code)]
|
||||||
#![allow(clippy::must_use_candidate, dead_code)]
|
#![allow(clippy::must_use_candidate, dead_code)]
|
||||||
|
|
||||||
mod cli;
|
mod cli;
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
|
#![forbid(unsafe_code)]
|
||||||
#![allow(
|
#![allow(
|
||||||
clippy::match_same_arms,
|
clippy::match_same_arms,
|
||||||
clippy::missing_errors_doc,
|
clippy::missing_errors_doc,
|
||||||
clippy::module_name_repetitions,
|
clippy::module_name_repetitions,
|
||||||
clippy::too_many_lines
|
clippy::too_many_lines
|
||||||
)]
|
)]
|
||||||
#![forbid(unsafe_code)]
|
|
||||||
|
|
||||||
use std::io::{self};
|
use std::io::{self};
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
//! This crate implements an internal CLI for developers of Ruff.
|
//! This crate implements an internal CLI for developers of Ruff.
|
||||||
//!
|
//!
|
||||||
//! Within the ruff repository you can run it with `cargo dev`.
|
//! Within the ruff repository you can run it with `cargo dev`.
|
||||||
|
#![forbid(unsafe_code)]
|
||||||
#![allow(
|
#![allow(
|
||||||
clippy::collapsible_else_if,
|
clippy::collapsible_else_if,
|
||||||
clippy::collapsible_if,
|
clippy::collapsible_if,
|
||||||
|
|
@ -13,7 +14,6 @@
|
||||||
clippy::similar_names,
|
clippy::similar_names,
|
||||||
clippy::too_many_lines
|
clippy::too_many_lines
|
||||||
)]
|
)]
|
||||||
#![forbid(unsafe_code)]
|
|
||||||
|
|
||||||
mod generate_all;
|
mod generate_all;
|
||||||
mod generate_cli_help;
|
mod generate_cli_help;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
//! This crate implements internal macros for the `ruff` library.
|
//! This crate implements internal macros for the `ruff` library.
|
||||||
|
#![forbid(unsafe_code)]
|
||||||
#![allow(
|
#![allow(
|
||||||
clippy::collapsible_else_if,
|
clippy::collapsible_else_if,
|
||||||
clippy::collapsible_if,
|
clippy::collapsible_if,
|
||||||
|
|
@ -11,7 +12,6 @@
|
||||||
clippy::similar_names,
|
clippy::similar_names,
|
||||||
clippy::too_many_lines
|
clippy::too_many_lines
|
||||||
)]
|
)]
|
||||||
#![forbid(unsafe_code)]
|
|
||||||
|
|
||||||
use proc_macro::TokenStream;
|
use proc_macro::TokenStream;
|
||||||
use syn::{parse_macro_input, DeriveInput, ItemFn};
|
use syn::{parse_macro_input, DeriveInput, ItemFn};
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
//! and subject to change drastically.
|
//! and subject to change drastically.
|
||||||
//!
|
//!
|
||||||
//! [Ruff]: https://github.com/charliermarsh/ruff
|
//! [Ruff]: https://github.com/charliermarsh/ruff
|
||||||
|
#![forbid(unsafe_code)]
|
||||||
#![allow(
|
#![allow(
|
||||||
clippy::collapsible_else_if,
|
clippy::collapsible_else_if,
|
||||||
clippy::collapsible_if,
|
clippy::collapsible_if,
|
||||||
|
|
@ -16,7 +17,6 @@
|
||||||
clippy::similar_names,
|
clippy::similar_names,
|
||||||
clippy::too_many_lines
|
clippy::too_many_lines
|
||||||
)]
|
)]
|
||||||
#![forbid(unsafe_code)]
|
|
||||||
|
|
||||||
mod ast;
|
mod ast;
|
||||||
mod autofix;
|
mod autofix;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue