Rollup merge of #5468 - Toxyxer:zero-single-char-names, r=flip1995
Zero single char names Fixes: #4086 changelog: - Make the inequality strict
This commit is contained in:
commit
19183a6af5
@ -93,7 +93,7 @@ impl<'a, 'tcx> SimilarNamesLocalVisitor<'a, 'tcx> {
|
||||
fn check_single_char_names(&self) {
|
||||
let num_single_char_names = self.single_char_names.iter().flatten().count();
|
||||
let threshold = self.lint.single_char_binding_names_threshold;
|
||||
if num_single_char_names as u64 >= threshold {
|
||||
if num_single_char_names as u64 > threshold {
|
||||
let span = self
|
||||
.single_char_names
|
||||
.iter()
|
||||
|
@ -135,7 +135,7 @@ define_Conf! {
|
||||
/// Lint: TYPE_COMPLEXITY. The maximum complexity a type can have
|
||||
(type_complexity_threshold, "type_complexity_threshold": u64, 250),
|
||||
/// Lint: MANY_SINGLE_CHAR_NAMES. The maximum number of single char bindings a scope may have
|
||||
(single_char_binding_names_threshold, "single_char_binding_names_threshold": u64, 5),
|
||||
(single_char_binding_names_threshold, "single_char_binding_names_threshold": u64, 4),
|
||||
/// Lint: BOXED_LOCAL. The maximum size of objects (in bytes) that will be linted. Larger objects are ok on the heap
|
||||
(too_large_for_stack, "too_large_for_stack": u64, 200),
|
||||
/// Lint: ENUM_VARIANT_NAMES. The minimum number of enum variants for the lints about variant names to trigger
|
||||
|
1
tests/ui-toml/zero_single_char_names/clippy.toml
Normal file
1
tests/ui-toml/zero_single_char_names/clippy.toml
Normal file
@ -0,0 +1 @@
|
||||
single-char-binding-names-threshold = 0
|
@ -0,0 +1,3 @@
|
||||
#![warn(clippy::many_single_char_names)]
|
||||
|
||||
fn main() {}
|
Loading…
Reference in New Issue
Block a user