Add allow-disallowed-*-in-tests
configuration items
#13790
Labels
A-ui
Area: Clippy interface, usage and configuration
C-enhancement
Category: Enhancement of lints, like adding more cases or adding help messages
L-restriction
Lint: Belongs in the restriction lint group
Description
Dear maintainers,
Whenever using one of the
disallowed-*
lints, one may only specify what is to be enabled, but very little is provided to conditionally disable. This makes workspace-wide refactors often tedious as one needs to#[allow]
or#[expect]
each use site of a macro, method, ... in tests (and other non-production modules) when adding a new element to one of these disallowed lists.In parallel of things like #8477 and #11433, an element that should therefore be both relatively easy and quickly useful to implement would be new configuration items for each of, in order of estimated priority:
disallowed_methods
disallowed_macros
disallowed_types
disallowed_names
disallowed_script_idents
to allow one to disable the lint under
#[cfg(test)]
gates, in a fashion as similar as possible toallow-dbg-in-tests
orallow-print-in-tests
for instance. The name for each could beallow-disallowed-*-in-tests
, for exampleallow-disallowed-macros-in-tests
.Thanks in advance,
Paul.
Version
Additional Labels
@rustbot label +C-enhancement +A-ui +L-restriction
The text was updated successfully, but these errors were encountered: