Skip to content

Commit

Permalink
[ci] delete old linter stuff
Browse files Browse the repository at this point in the history
lintrunner has been running for a while, so delete redundant linter
things

Pull Request resolved: pytorch#76984

Approved by: https://github.com/janeyx99
  • Loading branch information
suo authored and pytorchmergebot committed May 11, 2022
1 parent 533b44a commit 6cbe9d1
Show file tree
Hide file tree
Showing 28 changed files with 3 additions and 3,630 deletions.
32 changes: 3 additions & 29 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,38 +22,12 @@ linecount:
echo "Cloc is not available on the machine. You can install cloc with " && \
echo " sudo apt-get install cloc"

shellcheck:
@$(PYTHON) tools/actions_local_runner.py \
--file .github/workflows/lint.yml \
--job 'workflow-checks' \
--step "Regenerate workflows"
@$(PYTHON) tools/actions_local_runner.py \
--file .github/workflows/lint.yml \
--job 'workflow-checks' \
--step "Assert that regenerating the workflows didn't change them"

setup_lint:
$(PIP) install lintrunner
lintrunner init
$(PYTHON) -mpip install jinja2 --user

quick_checks:
# TODO: This is broken when 'git config submodule.recurse' is 'true' since the
# lints will descend into third_party submodules
@$(PYTHON) tools/actions_local_runner.py \
--file .github/workflows/lint.yml \
--job 'quick-checks' \
--step 'Ensure no versionless Python shebangs'

toc:
@$(PYTHON) tools/actions_local_runner.py \
--file .github/workflows/lint.yml \
--job 'toc' \
--step "Regenerate ToCs and check that they didn't change"

lint: quick_checks shellcheck

lint:
lintrunner

quicklint: CHANGED_ONLY=--changed-only
quicklint: quick_checks shellcheck
quicklint:
lintrunner
27 changes: 0 additions & 27 deletions tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,41 +33,14 @@ Build system pieces:

Developer tools which you might find useful:

* [linter/clang_tidy](linter/clang_tidy/__main__.py) - Script for running clang-tidy
on lines of your script which you changed.
* [extract_scripts.py](extract_scripts.py) - Extract scripts from
`.github/workflows/*.yml` into a specified dir, on which linters such as
[linter/run_shellcheck.sh](linter/run_shellcheck.sh) can be run. Assumes that every `run`
script has `shell: bash` unless a different shell is explicitly listed on that
specific step (so `defaults` doesn't currently work), but also has some rules
for other situations such as [actions/github-script][]. Exits with nonzero
status if any of the extracted scripts contain [GitHub Actions expressions][]:
`${{<expression> }}`
* [git_add_generated_dirs.sh](git_add_generated_dirs.sh) and
[git_reset_generated_dirs.sh](git_reset_generated_dirs.sh) -
Use this to force add generated files to your Git index, so that you
can conveniently run diffs on them when working on code-generation.
(See also [generated_dirs.txt](generated_dirs.txt) which
specifies the list of directories with generated files.)
* [linter/mypy_wrapper.py](linter/mypy_wrapper.py) - Run `mypy` on a single file using the
appropriate subset of our `mypy*.ini` configs.
* [linter/run_shellcheck.sh](linter/run_shellcheck.sh) - Find `*.sh` files (recursively) in
the directories specified as arguments, and run [ShellCheck][] on all of them.
* [stats/test_history.py](stats/test_history.py) - Query S3 to display history of a single
test across multiple jobs over time.
* [linter/trailing_newlines.py](linter/trailing_newlines.py) - Take names of UTF-8 files from
stdin, print names of nonempty files whose contents don't end in exactly one
trailing newline, exit with status 1 if no output printed or 0 if some
filenames were printed.
* [linter/translate_annotations.py](linter/translate_annotations.py) - Read [Flake8][] or
[clang-tidy][] warnings (according to a `--regex`) from a `--file`, convert to
the JSON format accepted by [pytorch/add-annotations-github-action], and
translate line numbers from `HEAD` back in time to the given `--commit` by
running `git diff-index --unified=0` appropriately.
* [vscode_settings.py](vscode_settings.py) - Merge
`.vscode/settings_recommended.json` into your workspace-local
`.vscode/settings.json`, preferring the former in case of conflicts but
otherwise preserving the latter as much as possible.

Important if you want to run on AMD GPU:

Expand Down
Loading

0 comments on commit 6cbe9d1

Please sign in to comment.