refactor(clippy): allow struct_excessive_bools

This commit is contained in:
Boshen 2023-10-16 14:44:49 +08:00
parent 1e1050f92f
commit eaeb63072f
No known key found for this signature in database
GPG key ID: 234DA6A7079C6801
9 changed files with 3 additions and 11 deletions

View file

@ -53,6 +53,8 @@ rustflags = [
# This rule is too pedantic, I don't want to force this because naming things are hard.
"-Aclippy::module_name_repetitions",
# Most usages are ignored in our codebase, so this is ignored.
"-Aclippy::struct_excessive_bools",
# #[must_use] is creating too much noise for this codebase, it does not add much value execept nagging
# the programmer to add a #[must_use] after clippy has been run.

View file

@ -1456,7 +1456,6 @@ pub struct RestElement<'a> {
/// Function Definitions
#[derive(Debug, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize), serde(rename_all = "camelCase"))]
#[allow(clippy::struct_excessive_bools)]
pub struct Function<'a> {
pub r#type: FunctionType,
#[cfg_attr(feature = "serde", serde(flatten))]
@ -1749,7 +1748,6 @@ impl<'a> ClassElement<'a> {
#[derive(Debug, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
#[allow(clippy::struct_excessive_bools)]
pub struct MethodDefinition<'a> {
#[cfg_attr(feature = "serde", serde(flatten))]
pub span: Span,
@ -1766,7 +1764,6 @@ pub struct MethodDefinition<'a> {
#[derive(Debug, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
#[allow(clippy::struct_excessive_bools)]
pub struct PropertyDefinition<'a> {
#[cfg_attr(feature = "serde", serde(flatten))]
pub span: Span,

View file

@ -36,7 +36,6 @@ declare var console: Console;
/// TODO temp
#[derive(Debug)]
#[allow(clippy::struct_excessive_bools)]
pub struct TypeCheckOptions {
pub path: PathBuf,
// TODO temp, for exhibition

View file

@ -2,7 +2,6 @@ use crate::{RuleCategory, RuleEnum, RULES};
use rustc_hash::FxHashSet;
#[derive(Debug)]
#[allow(clippy::struct_excessive_bools)]
pub struct LintOptions {
/// Allow / Deny rules in order. [("allow" / "deny", rule name)]
/// Defaults to [("deny", "correctness")]

View file

@ -13,7 +13,6 @@ use crate::{context::LintContext, rule::Rule};
#[diagnostic(severity(warning))]
struct FilenameCaseDiagnostic(#[label] pub Span, &'static str);
#[allow(clippy::struct_excessive_bools)]
#[derive(Debug, Clone)]
pub struct FilenameCase {
kebab_case: bool,

View file

@ -1,4 +1,3 @@
#[allow(clippy::struct_excessive_bools)]
#[derive(Debug, Clone, Copy)]
pub struct CompressOptions {
/// Various optimizations for boolean context, for example `!!a ? b : c` → `a ? b : c`.

View file

@ -5,7 +5,6 @@ use std::{fmt, path::PathBuf};
/// Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options).
///
/// See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples
#[allow(clippy::struct_excessive_bools)]
#[derive(Debug, Clone)]
pub struct ResolveOptions {
/// Path to TypeScript configuration file.

View file

@ -1,6 +1,5 @@
use wasm_bindgen::prelude::*;
#[allow(clippy::struct_excessive_bools)]
#[wasm_bindgen]
#[derive(Default, Clone, Copy)]
pub struct OxcRunOptions {

View file

@ -122,7 +122,6 @@ impl Case for TypeScriptCase {
}
}
#[allow(clippy::struct_excessive_bools)]
struct TypeScriptTestMeta {
pub tests: Vec<TestUnitData>,
pub options: CompilerOptions,
@ -213,7 +212,7 @@ struct TestUnitData {
}
#[derive(Debug)]
#[allow(unused, clippy::struct_excessive_bools)]
#[allow(unused)]
struct CompilerOptions {
pub modules: Vec<String>,
pub targets: Vec<String>,