Skip to content

Commit

Permalink
Refactor local lint (pytorch#58798)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: pytorch#58798

In pytorch#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
  • Loading branch information
driazati authored and facebook-github-bot committed May 24, 2021
1 parent a7f4f80 commit a679bb5
Show file tree
Hide file tree
Showing 3 changed files with 212 additions and 205 deletions.
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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'

Expand Down
Loading

0 comments on commit a679bb5

Please sign in to comment.