mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-17 06:52:56 +00:00
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`
This commit is contained in:
27
.pre-commit-config.yaml
Normal file
27
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
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
|
3
Makefile
3
Makefile
@@ -26,6 +26,7 @@ ALL_IMAGES:=$(ALL_STACKS)
|
||||
|
||||
# Linter
|
||||
HADOLINT="${HOME}/hadolint"
|
||||
HADOLINT_VERSION="v1.18.0"
|
||||
|
||||
help:
|
||||
# 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/$
|
||||
|
||||
lint-install: ## install 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)
|
||||
@echo "Installation done!"
|
||||
@$(HADOLINT) --version
|
||||
|
@@ -1,4 +1,5 @@
|
||||
docker
|
||||
pre-commit
|
||||
pytest
|
||||
recommonmark==0.5.0
|
||||
requests
|
||||
@@ -6,4 +7,3 @@ sphinx>=1.6
|
||||
sphinx-intl
|
||||
tabulate
|
||||
transifex-client
|
||||
|
||||
|
Reference in New Issue
Block a user