Refactor local lint (#58798)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/58798

In #58623 there was a bug in `make quicklint` where ShellCheck would run on the entire repo when there were no files. This PR fixes that by refactoring out common stuff (like skipping quicklint when there are no files, let checks do their own file filtering) and pushes the logic into a runner class.

Test Plan: Imported from OSS

Reviewed By: samestep

Differential Revision: D28649889

Pulled By: driazati

fbshipit-source-id: b19f32cdb63396c806cb689b2f6daf97e1724d44
This commit is contained in:
driazati
2021-05-24 13:49:47 -07:00
committed by Facebook GitHub Bot
parent a7f4f80903
commit a679bb5ecf
3 changed files with 218 additions and 211 deletions

View File

@ -46,7 +46,6 @@ shellcheck:
--job 'shellcheck' \
--step 'Extract scripts from GitHub Actions workflows'
@$(PYTHON) tools/actions_local_runner.py \
--file-filter '.sh' \
$(CHANGED_ONLY) \
--job 'shellcheck'
@ -90,13 +89,11 @@ quick_checks:
flake8:
@$(PYTHON) tools/actions_local_runner.py \
--file-filter '.py' \
$(CHANGED_ONLY) \
--job 'flake8-py3'
mypy:
@$(PYTHON) tools/actions_local_runner.py \
--file-filter '.py' \
$(CHANGED_ONLY) \
--job 'mypy'