pytorch/tools/linter/adapters
Catherine Lee 953e80936e [linter] Grep linter batches long command (#145950)
If the command is too long, the linter fails with
```
Failed due to OSError:
[Errno 7] Argument list too long: 'grep'
```
Fix this by batching the command so it is shorter

Limit of 750k was chosen due to `getconf ARG_MAX` returns ~1M on my mac.  My guess is that most people shouldn't hit this unless they run --all-files and the directory length is long.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/145950
Approved by: https://github.com/wdvr
2025-01-29 21:23:27 +00:00
..
_linter.py
actionlint_linter.py
bazel_linter.py
black_linter.py
clangformat_linter.py
clangtidy_linter.py
cmake_linter.py
docstring_linter.py
exec_linter.py
flake8_linter.py
gha_linter.py
grep_linter.py [linter] Grep linter batches long command (#145950) 2025-01-29 21:23:27 +00:00
import_linter.py
lintrunner_version_linter.py
mypy_linter.py Don't use mypy daemon in CI (#145961) 2025-01-29 21:15:29 +00:00
nativefunctions_linter.py
newlines_linter.py
no_merge_conflict_csv_linter.py
no_workflows_on_fork.py
pip_init.py
pyfmt_linter.py
README.md
ruff_linter.py
s3_init.py
s3_init_config.json
set_linter.py
shellcheck_linter.py
test_has_main_linter.py
testowners_linter.py
update_s3.py
workflow_consistency_linter.py

lintrunner adapters

These files adapt our various linters to work with lintrunner.

Adding a new linter

  1. init and linter
  2. {{DRYRUN}} and {{PATHSFILE}}
  3. never exit uncleanly
  4. Communication protocol
  5. Self-contained