Commit e2e1399c authored by Romain's avatar Romain

pre-commit hook added + minor fixes

## pre-commit
pre-commit added to check

- `bash` files with bashate see #1109
- `yaml` files with yamlint see #1108
- `docker` files with hadolint see #1100

# hadolint

version of the linter added as a variable in the `Makefile`
parent 5197709e
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.1.0
hooks:
#- id: flake8
- id: check-yaml
files: .*\.(yaml|yml)$
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.23.0
hooks:
- id: yamllint
files: \.(yaml|yml)$
exclude: ^.travis
- repo: https://github.com/openstack-dev/bashate.git
rev: 2.0.0
hooks:
- id: bashate
- repo: local
hooks:
- id: hadolint
name: Hadolint linter
description: Runs Hadolint to check for Dockerfile best practices
language: system
types:
- dockerfile
entry: make lint-all
...@@ -26,6 +26,7 @@ ALL_IMAGES:=$(ALL_STACKS) ...@@ -26,6 +26,7 @@ ALL_IMAGES:=$(ALL_STACKS)
# Linter # Linter
HADOLINT="${HOME}/hadolint" HADOLINT="${HOME}/hadolint"
HADOLINT_VERSION="v1.18.0"
help: help:
# http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html # http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
...@@ -88,7 +89,7 @@ lint-build-test-all: $(foreach I,$(ALL_IMAGES),lint/$(I) arch_patch/$(I) build/$ ...@@ -88,7 +89,7 @@ lint-build-test-all: $(foreach I,$(ALL_IMAGES),lint/$(I) arch_patch/$(I) build/$
lint-install: ## install hadolint lint-install: ## install hadolint
@echo "Installing hadolint at $(HADOLINT) ..." @echo "Installing hadolint at $(HADOLINT) ..."
@curl -sL -o $(HADOLINT) "https://github.com/hadolint/hadolint/releases/download/v1.18.0/hadolint-$(shell uname -s)-$(shell uname -m)" @curl -sL -o $(HADOLINT) "https://github.com/hadolint/hadolint/releases/download/$(HADOLINT_VERSION)/hadolint-$(shell uname -s)-$(shell uname -m)"
@chmod 700 $(HADOLINT) @chmod 700 $(HADOLINT)
@echo "Installation done!" @echo "Installation done!"
@$(HADOLINT) --version @$(HADOLINT) --version
......
docker docker
pre-commit
pytest pytest
recommonmark==0.5.0 recommonmark==0.5.0
requests requests
...@@ -6,4 +7,3 @@ sphinx>=1.6 ...@@ -6,4 +7,3 @@ sphinx>=1.6
sphinx-intl sphinx-intl
tabulate tabulate
transifex-client transifex-client
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment