mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
[Makefile] lazily setup lintrunner
on first make lint
run (#156058)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/156058 Approved by: https://github.com/ezyang
This commit is contained in:
committed by
PyTorch MergeBot
parent
242eb19c83
commit
1c960c5638
26
Makefile
26
Makefile
@ -57,19 +57,35 @@ setup-env-cuda:
|
||||
setup-env-rocm:
|
||||
$(MAKE) setup-env PYTHON="$(PYTHON)" NIGHTLY_TOOL_OPTS="$(NIGHTLY_TOOL_OPTS) --rocm"
|
||||
|
||||
.PHONY: setup-lint
|
||||
setup-lint:
|
||||
.lintbin/.lintrunner.sha256: requirements.txt pyproject.toml .lintrunner.toml
|
||||
@echo "Setting up lintrunner..."
|
||||
$(PIP) install lintrunner
|
||||
lintrunner init
|
||||
@echo "Generating .lintrunner.sha256..."
|
||||
@mkdir -p .lintbin
|
||||
@sha256sum requirements.txt pyproject.toml .lintrunner.toml > .lintbin/.lintrunner.sha256
|
||||
|
||||
.PHONY: setup-lint
|
||||
setup-lint: .lintbin/.lintrunner.sha256
|
||||
|
||||
.PHONY: lazy-setup-lint
|
||||
lazy-setup-lint: .lintbin/.lintrunner.sha256
|
||||
@if [ ! -x "$(shell command -v lintrunner)" ]; then \
|
||||
$(MAKE) setup-lint; \
|
||||
fi
|
||||
|
||||
.PHONY: lint
|
||||
lint:
|
||||
lintrunner
|
||||
lint: lazy-setup-lint
|
||||
lintrunner --all-files
|
||||
|
||||
.PHONY: quicklint
|
||||
quicklint:
|
||||
quicklint: lazy-setup-lint
|
||||
lintrunner
|
||||
|
||||
.PHONY: quickfix
|
||||
quickfix: lazy-setup-lint
|
||||
lintrunner --apply-patches
|
||||
|
||||
# Deprecated target aliases
|
||||
.PHONY: setup_env setup_env_cuda setup_env_rocm setup_lint
|
||||
setup_env: setup-env
|
||||
|
Reference in New Issue
Block a user