Skip to content

Commit

Permalink
Update doc generation script
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibsG committed Apr 1, 2020
1 parent 62d6878 commit 60ede1d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions clippy_lints/src/large_const_arrays.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use crate::rustc_target::abi::LayoutOf;
use crate::utils::span_lint_and_then;
use if_chain::if_chain;
use rustc::mir::interpret::ConstValue;
use rustc::ty::{self, ConstKind};
use rustc_errors::Applicability;
use rustc_hir::{Item, ItemKind};
use rustc_lint::{LateContext, LateLintPass};
use rustc_middle::mir::interpret::ConstValue;
use rustc_middle::ty::{self, ConstKind};
use rustc_session::{declare_tool_lint, impl_lint_pass};
use rustc_span::{BytePos, Pos, Span};
use rustc_typeck::hir_ty_to_ty;
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/utils/conf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ define_Conf! {
(trivial_copy_size_limit, "trivial_copy_size_limit": Option<u64>, None),
/// Lint: TOO_MANY_LINES. The maximum number of lines a function or method can have
(too_many_lines_threshold, "too_many_lines_threshold": u64, 100),
/// Lint: LARGE_STACK_ARRAYS. The maximum allowed size for arrays on the stack
/// Lint: LARGE_STACK_ARRAYS, LARGE_CONST_ARRAYS. The maximum allowed size for arrays on the stack
(array_size_threshold, "array_size_threshold": u64, 512_000),
/// Lint: VEC_BOX. The size of the boxed type in bytes, where boxing in a `Vec` is allowed
(vec_box_size_threshold, "vec_box_size_threshold": u64, 4096),
Expand Down
8 changes: 4 additions & 4 deletions util/lintlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
group_re = re.compile(r'''\s*([a-z_][a-z_0-9]+)''')
conf_re = re.compile(r'''define_Conf! {\n([^}]*)\n}''', re.MULTILINE)
confvar_re = re.compile(
r'''/// Lint: (\w+)\. (.*)\n\s*\([^,]+,\s+"([^"]+)":\s+([^,]+),\s+([^\.\)]+).*\),''', re.MULTILINE)
r'''/// Lint: ([\w,\s]+)\. (.*)\n\s*\([^,]+,\s+"([^"]+)":\s+([^,]+),\s+([^\.\)]+).*\),''', re.MULTILINE)
comment_re = re.compile(r'''\s*/// ?(.*)''')

lint_levels = {
Expand Down Expand Up @@ -93,9 +93,9 @@ def parse_configs(path):
match = re.search(conf_re, contents)
confvars = re.findall(confvar_re, match.group(1))

for (lint, doc, name, ty, default) in confvars:
configs[lint.lower()] = Config(name.replace("_", "-"), ty, doc, default)

for (lints, doc, name, ty, default) in confvars:
for lint in lints.split(','):
configs[lint.strip().lower()] = Config(name.replace("_", "-"), ty, doc, default)
return configs


Expand Down

0 comments on commit 60ede1d

Please sign in to comment.