Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitecc3718

Browse files
driazatifacebook-github-bot
authored andcommitted
Fix clang-tidy path filtering (#60225)
Summary:PR#60048 neglected to include the `--paths` option for file filtering, so it ended up passing every changed file in the diff to clang-tidy (cpp files outside `torch/csrc/`, yaml/sh files, etc.). This adds that back in to make the filtering work properly again.Tested it manually by printing out the files to lint and running```bashcurl -Lhttps://github.com/pytorch/pytorch/pull/60018.diff > diffpython tools/clang_tidy.py --diff-file diff --paths torch/csrc/curl -Lhttps://github.com/pytorch/pytorch/pull/60222.diff > diffpython tools/clang_tidy.py --diff-file diff --paths torch/csrc/```Shouldfix#60192 andfix#60193, the files tripping errors there shouldn't have been passed to clang-tidy in the first place (supporting aten/ for clang-tidy is a separate task)Pull Requestresolved:#60225Reviewed By: zhouzhuojieDifferential Revision: D29216251Pulled By: driazatifbshipit-source-id: b5d7fb7161d33eb7958a6f1ccc25809942045209
1 parent38c3116 commitecc3718

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎tools/clang_tidy.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ def find_changed_lines(diff: str) -> Dict[str, List[Tuple[int, int]]]:
142142
forfile,start,endinmatches:
143143
start_line,_=start.split(",")
144144
end_line,_=end.split(",")
145-
print(file,start_line,end_line)
146145

147146
files[file].append((start_line,end_line))
148147

@@ -330,6 +329,11 @@ def main() -> None:
330329
ifoptions.diff_file:
331330
withopen(options.diff_file,"r")asf:
332331
changed_files=find_changed_lines(f.read())
332+
changed_files= {
333+
filename:v
334+
forfilename,vinchanged_files.items()
335+
ifany(filename.startswith(path)forpathinoptions.paths)
336+
}
333337
line_filters= [
334338
{"name":name,"lines":lines}forname,lines,inchanged_files.items()
335339
]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp