Skip to content

Commit

Permalink
chore: bump derive_more to v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jayvdb committed Aug 17, 2024
1 parent 6235f27 commit 2dd4485
Show file tree
Hide file tree
Showing 51 changed files with 146 additions and 153 deletions.
43 changes: 18 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ serde = { version = "1.0.195", features = ["derive"] }
serde_json = "1.0.111"
regex = "1.10.2"
once_cell = "1.19.0"
derive_more = { version = "0.99.17", features = ["display"] }
derive_more = { version = "1.0", features = ["display"] }
anyhow = "1.0.79"
if_chain = "1.0.2"
phf = { version = "0.11.2", features = ["macros"] }
Expand Down
12 changes: 6 additions & 6 deletions src/rules/adjacent_overload_signatures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ const CODE: &str = "adjacent-overload-signatures";

#[derive(Display)]
enum AdjacentOverloadSignaturesMessage {
#[display(fmt = "All `{}` signatures should be adjacent", _0)]
#[display("All `{}` signatures should be adjacent", _0)]
ShouldBeAdjacent(String),
}

#[derive(Display)]
enum AdjacentOverloadSignaturesHint {
#[display(fmt = "Make sure all overloaded signatures are grouped together")]
#[display("Make sure all overloaded signatures are grouped together")]
GroupedTogether,
}

Expand Down Expand Up @@ -204,13 +204,13 @@ impl<'a> ExtractMethod for ast_view::TsTypeElement<'a> {
#[derive(PartialEq, Eq, Hash, Clone, Display)]
#[allow(clippy::enum_variant_names)]
enum Method {
#[display(fmt = "{}", _0)]
#[display("{}", _0)]
Method(String),
#[display(fmt = "{}", _0)]
#[display("{}", _0)]
Static(String),
#[display(fmt = "call")]
#[display("call")]
CallSignature,
#[display(fmt = "new")]
#[display("new")]
ConstructSignature,
}

Expand Down
4 changes: 2 additions & 2 deletions src/rules/default_param_last.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ const CODE: &str = "default-param-last";

#[derive(Display)]
enum DefaultParamLastMessage {
#[display(fmt = "default parameters should be at last")]
#[display("default parameters should be at last")]
DefaultLast,
}

#[derive(Display)]
enum DefaultParamLastHint {
#[display(
fmt = "Modify the signatures to move default parameter(s) to the end"
"Modify the signatures to move default parameter(s) to the end"
)]
MoveToEnd,
}
Expand Down
8 changes: 4 additions & 4 deletions src/rules/eqeqeq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ const CODE: &str = "eqeqeq";

#[derive(Display)]
enum EqeqeqMessage {
#[display(fmt = "expected '===' and instead saw '=='.")]
#[display("expected '===' and instead saw '=='.")]
ExpectedEqual,
#[display(fmt = "expected '!==' and instead saw '!='.")]
#[display("expected '!==' and instead saw '!='.")]
ExpectedNotEqual,
}

#[derive(Display)]
enum EqeqeqHint {
#[display(fmt = "Use '==='")]
#[display("Use '==='")]
UseEqeqeq,
#[display(fmt = "Use '!=='")]
#[display("Use '!=='")]
UseNoteqeq,
}

Expand Down
4 changes: 2 additions & 2 deletions src/rules/explicit_function_return_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ const CODE: &str = "explicit-function-return-type";

#[derive(Display)]
enum ExplicitFunctionReturnTypeMessage {
#[display(fmt = "Missing return type on function")]
#[display("Missing return type on function")]
MissingRetType,
}

#[derive(Display)]
enum ExplicitFunctionReturnTypeHint {
#[display(fmt = "Add a return type to the function signature")]
#[display("Add a return type to the function signature")]
AddRetType,
}

Expand Down
8 changes: 4 additions & 4 deletions src/rules/explicit_module_boundary_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ const CODE: &str = "explicit-module-boundary-types";

#[derive(Display)]
enum ExplicitModuleBoundaryTypesMessage {
#[display(fmt = "Missing return type on function")]
#[display("Missing return type on function")]
MissingRetType,

#[display(fmt = "All arguments should be typed")]
#[display("All arguments should be typed")]
MissingArgType,
}

#[derive(Display)]
enum ExplicitModuleBoundaryTypesHint {
#[display(fmt = "Add a return type to the function signature")]
#[display("Add a return type to the function signature")]
AddRetType,

#[display(fmt = "Add types to all the function arguments")]
#[display("Add types to all the function arguments")]
AddArgTypes,
}

Expand Down
6 changes: 3 additions & 3 deletions src/rules/getter_return.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ const CODE: &str = "getter-return";

#[derive(Display)]
enum GetterReturnMessage {
#[display(fmt = "Expected to return a value in '{}'.", _0)]
#[display("Expected to return a value in '{}'.", _0)]
Expected(String),
#[display(fmt = "Expected '{}' to always return a value.", _0)]
#[display("Expected '{}' to always return a value.", _0)]
ExpectedAlways(String),
}

#[derive(Display)]
enum GetterReturnHint {
#[display(fmt = "Return a value from the getter function")]
#[display("Return a value from the getter function")]
Return,
}

Expand Down
4 changes: 2 additions & 2 deletions src/rules/no_compare_neg_zero.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ const CODE: &str = "no-compare-neg-zero";

#[derive(Display)]
enum NoCompareNegZeroMessage {
#[display(fmt = "Do not compare against -0")]
#[display("Do not compare against -0")]
Unexpected,
}

#[derive(Display)]
enum NoCompareNegZeroHint {
#[display(fmt = "Use Object.is(x, -0) instead")]
#[display("Use Object.is(x, -0) instead")]
ObjectIs,
}

Expand Down
4 changes: 2 additions & 2 deletions src/rules/no_cond_assign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ const CODE: &str = "no-cond-assign";
#[derive(Display)]
enum NoCondAssignMessage {
#[display(
fmt = "Expected a conditional expression and instead saw an assignment"
"Expected a conditional expression and instead saw an assignment"
)]
Unexpected,
}

#[derive(Display)]
enum NoCondAssignHint {
#[display(
fmt = "Change assignment (`=`) to comparison (`===`) or move assignment out of condition"
"Change assignment (`=`) to comparison (`===`) or move assignment out of condition"
)]
ChangeOrMove,
}
Expand Down
4 changes: 2 additions & 2 deletions src/rules/no_const_assign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ const CODE: &str = "no-const-assign";

#[derive(Display)]
enum NoConstantAssignMessage {
#[display(fmt = "Reassigning constant variable is not allowed")]
#[display("Reassigning constant variable is not allowed")]
Unexpected,
}

#[derive(Display)]
enum NoConstantAssignHint {
#[display(
fmt = "Change `const` declaration to `let` or double check the correct variable is used"
"Change `const` declaration to `let` or double check the correct variable is used"
)]
Remove,
}
Expand Down
4 changes: 2 additions & 2 deletions src/rules/no_constant_condition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ const CODE: &str = "no-constant-condition";
#[derive(Display)]
enum NoConstantConditionMessage {
#[display(
fmt = "Use of a constant expressions as conditions is not allowed."
"Use of a constant expressions as conditions is not allowed."
)]
Unexpected,
}

#[derive(Display)]
enum NoConstantConditionHint {
#[display(fmt = "Remove the constant expression")]
#[display("Remove the constant expression")]
Remove,
}

Expand Down
4 changes: 2 additions & 2 deletions src/rules/no_control_regex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const CODE: &str = "no-control-regex";
#[derive(Display)]
enum NoControlRegexMessage {
#[display(
fmt = "Unexpected control character(s) in regular expression: \\x{:x}.",
"Unexpected control character(s) in regular expression: \\x{:x}.",
_0
)]
Unexpected(u64),
Expand All @@ -27,7 +27,7 @@ enum NoControlRegexMessage {
#[derive(Display)]
enum NoControlRegexHint {
#[display(
fmt = "Disable the rule if the control character (\\x... or \\u00..) was intentional, otherwise rework your RegExp"
"Disable the rule if the control character (\\x... or \\u00..) was intentional, otherwise rework your RegExp"
)]
DisableOrRework,
}
Expand Down
4 changes: 2 additions & 2 deletions src/rules/no_debugger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ const CODE: &str = "no-debugger";

#[derive(Display)]
enum NoDebuggerMessage {
#[display(fmt = "`debugger` statement is not allowed")]
#[display("`debugger` statement is not allowed")]
Unexpected,
}

#[derive(Display)]
enum NoDebuggerHint {
#[display(fmt = "Remove the `debugger` statement")]
#[display("Remove the `debugger` statement")]
Remove,
}

Expand Down
4 changes: 2 additions & 2 deletions src/rules/no_delete_var.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ const CODE: &str = "no-delete-var";

#[derive(Display)]
enum NoDeleteVarMessage {
#[display(fmt = "Variables shouldn't be deleted")]
#[display("Variables shouldn't be deleted")]
Unexpected,
}

#[derive(Display)]
enum NoDeleteVarHint {
#[display(fmt = "Remove the deletion statement")]
#[display("Remove the deletion statement")]
Remove,
}

Expand Down
4 changes: 2 additions & 2 deletions src/rules/no_dupe_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ const CODE: &str = "no-dupe-args";

#[derive(Display)]
enum NoDupeArgsMessage {
#[display(fmt = "Duplicate arguments not allowed")]
#[display("Duplicate arguments not allowed")]
Unexpected,
}

#[derive(Display)]
enum NoDupeArgsHint {
#[display(fmt = "Rename or remove the duplicate (e.g. same name) argument")]
#[display("Rename or remove the duplicate (e.g. same name) argument")]
RenameOrRemove,
}

Expand Down
4 changes: 2 additions & 2 deletions src/rules/no_dupe_class_members.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ const CODE: &str = "no-dupe-class-members";

#[derive(Display)]
enum NoDupeClassMembersMessage {
#[display(fmt = "Duplicate name '{}'", _0)]
#[display("Duplicate name '{}'", _0)]
Duplicate(String),
}

#[derive(Display)]
enum NoDupeClassMembersHint {
#[display(fmt = "Rename or remove the function with the duplicated name")]
#[display("Rename or remove the function with the duplicated name")]
RenameOrRemove,
}

Expand Down
4 changes: 2 additions & 2 deletions src/rules/no_dupe_else_if.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ const CODE: &str = "no-dupe-else-if";
#[derive(Display)]
enum NoDupeElseIfMessage {
#[display(
fmt = "This branch can never execute. Its condition is a duplicate or covered by previous conditions in the if-else-if chain."
"This branch can never execute. Its condition is a duplicate or covered by previous conditions in the if-else-if chain."
)]
Unexpected,
}

#[derive(Display)]
enum NoDupeElseIfHint {
#[display(
fmt = "Remove or rework the `else if` condition which is duplicated"
"Remove or rework the `else if` condition which is duplicated"
)]
RemoveOrRework,
}
Expand Down
Loading

0 comments on commit 2dd4485

Please sign in to comment.