pytorch
bfc80b35 - Give line numbers in git-grep-based lints (#53733)

Commit
3 years ago
Give line numbers in git-grep-based lints (#53733) Summary: Meant to make tasks like https://github.com/pytorch/pytorch/issues/53728 easier. The `-n` flag enables line numbers, and the `-o` flag reduces noise by only showing the part of the line that matched (which in this case is just the trailing whitespace). Pull Request resolved: https://github.com/pytorch/pytorch/pull/53733 Test Plan: ``` $ git checkout e937db5dbaeaeae1134b02b3b78c43db3f6a91cd ``` Before: ``` $ (! git grep -I -l ' $' -- . ':(exclude)**/contrib/**' ':(exclude)third_party' || (echo "The above files have trailing spaces; please remove them"; false)) aten/src/ATen/native/cuda/BatchLinearAlgebra.cu The above files have trailing spaces; please remove them ``` After: ``` $ (! git grep -I -no ' $' -- . ':(exclude)**/contrib/**' ':(exclude)third_party' || (echo "The above files have trailing spaces; please remove them"; false)) aten/src/ATen/native/cuda/BatchLinearAlgebra.cu:1972: The above files have trailing spaces; please remove them ``` Reviewed By: mruberry Differential Revision: D26953538 Pulled By: samestep fbshipit-source-id: 5f7d48b79f1a02e5e5a09fe00316ec350cfc340e
Author
Parents
Loading