Skip to content

Commit

Permalink
fixup! fixup! build: add YAML linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Trott committed Sep 5, 2021
1 parent 8a1a746 commit 045fdad
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions Makefile
Expand Up @@ -1410,19 +1410,16 @@ endif
.PHONY: lint-yaml-build
# python -m pip install yamllint
# Try with '--system' if it fails without; the system may have set '--user'
# Jenkins CI lint job uses python2 for linting. When Node.js 12.x is EOL, we
# can remove that from the Jenkins job config and $(PYTHON) for YAML linting
# just like everywhere else. (yamllint does not support Python 2.)
lint-yaml-build:
$(info Pip installing yamllint on $(shell $(PYTHON) --version)...)
python3 -m pip install --upgrade -t tools/pip/site-packages yamllint || \
python3 -m pip install --upgrade --system -t tools/pip/site-packages yamllint
$(PYTHON) -m pip install --upgrade -t tools/pip/site-packages yamllint || \
$(PYTHON) -m pip install --upgrade --system -t tools/pip/site-packages yamllint

.PHONY: lint-yaml
# Lints the YAML files with yamllint.
lint-yaml:
@if [ -f "tools/pip/site-packages/yamllint" ]; then \
PYTHONPATH=tools/pip python3 -m yamllint .; \
PYTHONPATH=tools/pip $(PYTHON) -m yamllint .; \
else \
$(warning YAML linting with yamllint is not available) \
$(warning Run 'make lint-yaml-build') \
Expand Down

0 comments on commit 045fdad

Please sign in to comment.