[BE] Enable C419 rule for any all shortcircuiting (#99890)

Apparently https://github.com/pytorch/pytorch/pull/78142 made torch.JIT allow for simple generator expressions which allows us to enable rules that replace unnecessary list comprehensions with generators in any/all. This was originally part of #99280 but I split it off into this PR so that it can be easily reverted should anything break.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/99890
Approved by: https://github.com/justinchuby, https://github.com/kit1980, https://github.com/malfet
This commit is contained in:
Aaron Gokaslan
2023-04-25 15:02:13 +00:00
committed by PyTorch MergeBot
parent e43918b93a
commit e2a3817dfd
83 changed files with 175 additions and 203 deletions

View File

@ -57,7 +57,7 @@ def is_intrested_file(
file_path: str, interested_folders: List[str], platform: TestPlatform
) -> bool:
ignored_patterns = ["cuda", "aten/gen_aten", "aten/aten_", "build/"]
if any([pattern in file_path for pattern in ignored_patterns]):
if any(pattern in file_path for pattern in ignored_patterns):
return False
# ignore files that are not belong to pytorch