From 431adfd03e8fc5cbb72d6d41fb003f2b8c46ecba Mon Sep 17 00:00:00 2001 From: Daniel Pryor Date: Thu, 28 Jun 2018 23:56:14 -0600 Subject: [PATCH] Adding flake8 config and dockerfilelint Precommit-Verified: d4333bcd762db20b08ac242f146a28c1d3cb35fd5f43f472a8aef43184b7eb04 --- .flake8 | 2 ++ .pre-commit-config.yaml | 6 +++--- Dockerfile | 20 +++++++++++++++++--- 3 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 .flake8 diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..6deafc2 --- /dev/null +++ b/.flake8 @@ -0,0 +1,2 @@ +[flake8] +max-line-length = 120 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a5da078..184e256 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,10 +33,10 @@ repos: - --autofix - id: flake8 stages: [commit] -- repo: https://github.com/Lucas-C/pre-commit-hooks-nodejs - rev: v1.1.0 +- repo: https://github.com/pryorda/dockerfilelint-precommit-hooks + rev: v0.1.0 hooks: - - id: dockerfile_lint + - id: dockerfilelint stages: [commit] - repo: https://github.com/mattlqx/pre-commit-sign rev: v1.1.1 diff --git a/Dockerfile b/Dockerfile index ae55529..73ffc11 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,22 @@ +FROM python:2.7-alpine as linter +# Runs required lints so automated builds are a little more fluid + +WORKDIR /opt/vmware_exporter/ +COPY . /opt/vmware_exporter/ + +RUN pip install flake8 && \ + apk add --no-cache --update nodejs && \ + npm install -g dockerfilelint + +RUN flake8 vmware_exporter +RUN dockerfilelint Dockerfile + + FROM python:2.7-alpine -LABEL MAINTAINER Daniel Pryor -LABEL NAME vmware_exporter -LABEL VERSION 0.20 +LABEL MAINTAINER="Daniel Pryor " +LABEL NAME=vmware_exporter +LABEL VERSION=0.20 WORKDIR /opt/vmware_exporter/