Skip to content

Commit 1d4c9a1

Browse files
committed
pacify Unrecognized tidy directive lint
1 parent 31ee3e2 commit 1d4c9a1

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/tools/tidy/src/style.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,10 @@ pub fn check(path: &Path, bad: &mut bool) {
507507
.any(|directive| matches!(directive, Directive::Ignore(_)));
508508
let has_alphabetical_directive = line.contains("tidy-alphabetical-start")
509509
|| line.contains("tidy-alphabetical-end");
510-
let has_recognized_directive =
511-
has_recognized_ignore_directive || has_alphabetical_directive;
510+
let has_tidy_watcher_directive = line.contains("tidy-keep-sync-with");
511+
let has_recognized_directive = has_recognized_ignore_directive
512+
|| has_alphabetical_directive
513+
|| has_tidy_watcher_directive;
512514
if contains_potential_directive && (!has_recognized_directive) {
513515
err("Unrecognized tidy directive")
514516
}

src/tools/tidy/src/watcher/tests.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ fn test_span_hash_has_some_text_in_line_before_second_tag() {
3535
let source = r#"
3636
RUN ./build-clang.sh
3737
ENV CC=clang CXX=clang++
38-
# tidy-ticket-perf-commit
38+
# tidy-keep-sync-with=tidy-ticket-perf-commit
3939
# rustc-perf version from 2023-05-30
4040
ENV PERF_COMMIT 8b2ac3042e1ff2c0074455a0a3618adef97156b1
41-
# tidy-ticket-perf-commit
41+
# tidy-keep-sync-with=tidy-ticket-perf-commit
4242
RUN curl -LS -o perf.zip https://github.com/rust-lang/rustc-perf/archive/$PERF_COMMIT.zip && \
4343
unzip perf.zip && \
4444
mv rustc-perf-$PERF_COMMIT rustc-perf && \

0 commit comments

Comments
 (0)