Skip to content

Commit 6f328f9

Browse files
committed
address review comments and rebase
ci: always build with internal lints group up internal lints in lib.rs dogfood: we already pass --all-features, no need to enable internal-lints again
1 parent b25a6df commit 6f328f9

File tree

3 files changed

+14
-20
lines changed

3 files changed

+14
-20
lines changed

.github/workflows/clippy_bors.yml

-7
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,6 @@ jobs:
128128
SYSROOT=$(rustc --print sysroot)
129129
echo "$SYSROOT/bin" >> $GITHUB_PATH
130130
131-
- name: Build
132-
run: cargo build --features deny-warnings
133-
134-
# compiletest would panic due to "Found multiple rlibs for crate `clippy_lints`"
135-
- name: clean rlibs
136-
run: rm -f ./target/debug/deps/libclippy_lints*
137-
138131
- name: Build with internal lints
139132
run: cargo build --features deny-warnings,internal-lints
140133

clippy_lints/src/lib.rs

+14-12
Original file line numberDiff line numberDiff line change
@@ -939,17 +939,24 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
939939
&zero_div_zero::ZERO_DIVIDED_BY_ZERO,
940940
]);
941941
// end register lints, do not remove this comment, it’s used in `update_lints`
942-
store.register_late_pass(|| box await_holding_invalid::AwaitHolding);
943-
store.register_late_pass(|| box serde_api::SerdeAPI);
942+
943+
// all the internal lints
944944
#[cfg(feature = "internal-lints")]
945945
{
946+
store.register_early_pass(|| box utils::internal_lints::ClippyLintsInternal);
947+
store.register_early_pass(|| box utils::internal_lints::ProduceIce);
948+
store.register_late_pass(|| box utils::inspector::DeepCodeInspector);
949+
store.register_late_pass(|| box utils::internal_lints::CollapsibleCalls);
946950
store.register_late_pass(|| box utils::internal_lints::CompilerLintFunctions::new());
951+
store.register_late_pass(|| box utils::internal_lints::InvalidPaths);
947952
store.register_late_pass(|| box utils::internal_lints::LintWithoutLintPass::default());
953+
store.register_late_pass(|| box utils::internal_lints::MatchTypeOnDiagItem);
948954
store.register_late_pass(|| box utils::internal_lints::OuterExpnDataPass);
949-
store.register_late_pass(|| box utils::internal_lints::InvalidPaths);
950-
store.register_late_pass(|| box utils::inspector::DeepCodeInspector);
951955
}
952956
store.register_late_pass(|| box utils::author::Author);
957+
store.register_late_pass(|| box await_holding_invalid::AwaitHolding);
958+
store.register_late_pass(|| box serde_api::SerdeAPI);
959+
953960
let vec_box_size_threshold = conf.vec_box_size_threshold;
954961
store.register_late_pass(move || box types::Types::new(vec_box_size_threshold));
955962
store.register_late_pass(|| box booleans::NonminimalBool);
@@ -1134,8 +1141,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
11341141
store.register_early_pass(|| box literal_representation::LiteralDigitGrouping);
11351142
let literal_representation_threshold = conf.literal_representation_threshold;
11361143
store.register_early_pass(move || box literal_representation::DecimalLiteralRepresentation::new(literal_representation_threshold));
1137-
#[cfg(feature = "internal-lints")]
1138-
store.register_early_pass(|| box utils::internal_lints::ClippyLintsInternal);
1144+
11391145
let enum_variant_name_threshold = conf.enum_variant_name_threshold;
11401146
store.register_early_pass(move || box enum_variants::EnumVariantNames::new(enum_variant_name_threshold));
11411147
store.register_early_pass(|| box tabs_in_doc_comments::TabsInDocComments);
@@ -1149,8 +1155,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
11491155
store.register_late_pass(move || box large_const_arrays::LargeConstArrays::new(array_size_threshold));
11501156
store.register_late_pass(|| box floating_point_arithmetic::FloatingPointArithmetic);
11511157
store.register_early_pass(|| box as_conversions::AsConversions);
1152-
#[cfg(feature = "internal-lints")]
1153-
store.register_early_pass(|| box utils::internal_lints::ProduceIce);
1158+
11541159
store.register_late_pass(|| box let_underscore::LetUnderscore);
11551160
store.register_late_pass(|| box atomic_ordering::AtomicOrdering);
11561161
store.register_early_pass(|| box single_component_path_imports::SingleComponentPathImports);
@@ -1166,8 +1171,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
11661171
store.register_late_pass(|| box dereference::Dereferencing);
11671172
store.register_late_pass(|| box option_if_let_else::OptionIfLetElse);
11681173
store.register_late_pass(|| box future_not_send::FutureNotSend);
1169-
#[cfg(feature = "internal-lints")]
1170-
store.register_late_pass(|| box utils::internal_lints::CollapsibleCalls);
1174+
11711175
store.register_late_pass(|| box if_let_mutex::IfLetMutex);
11721176
store.register_late_pass(|| box mut_mutex_lock::MutMutexLock);
11731177
store.register_late_pass(|| box match_on_vec_items::MatchOnVecItems);
@@ -1192,8 +1196,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
11921196
store.register_late_pass(|| box manual_ok_or::ManualOkOr);
11931197
store.register_late_pass(|| box float_equality_without_abs::FloatEqualityWithoutAbs);
11941198
store.register_late_pass(|| box async_yields_async::AsyncYieldsAsync);
1195-
#[cfg(feature = "internal-lints")]
1196-
store.register_late_pass(|| box utils::internal_lints::MatchTypeOnDiagItem);
11971199
let disallowed_methods = conf.disallowed_methods.iter().cloned().collect::<FxHashSet<_>>();
11981200
store.register_late_pass(move || box disallowed_method::DisallowedMethod::new(&disallowed_methods));
11991201
store.register_early_pass(|| box asm_syntax::InlineAsmX86AttSyntax);

tests/dogfood.rs

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ fn dogfood_clippy() {
2727
.arg("clippy-preview")
2828
.arg("--all-targets")
2929
.arg("--all-features")
30-
.args(&["--features", "internal-lints"])
3130
.arg("--")
3231
.args(&["-D", "clippy::all"])
3332
.args(&["-D", "clippy::pedantic"])

0 commit comments

Comments
 (0)