Skip to content
This repository has been archived by the owner on Mar 1, 2022. It is now read-only.

Commit

Permalink
Use linters for static analysis of Python code (#6)
Browse files Browse the repository at this point in the history
To help identify common Python mistakes, run pylint and flake8 on all
Python source code. This will help ensure a baseline level of quality
for all Python code in this repository.
  • Loading branch information
zjs committed Aug 20, 2018
1 parent 6ab20d9 commit cfde16f
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,24 @@

SHELL = /bin/bash -O globstar

.PHONY: all check shellcheck dockerfile_lint
PYTHON_FILES = $(shell find . -type f -name '*.py')

.PHONY: all check shellcheck dockerfile_lint check-python pylint flake8
.DEFAULT_GOAL := all

all: check
check: shellcheck dockerfile_lint
check: shellcheck dockerfile_lint check-python
check-python: pylint flake8

shellcheck:
@shellcheck **/*.sh

dockerfile_lint:
@docker run -it --rm --privileged -v $(PWD):/root/ projectatomic/dockerfile-lint dockerfile_lint -p -f images/*/Dockerfile

pylint:
@docker run --rm -v $(PWD):/code eeacms/pylint

flake8:
@docker run --rm -v $(PWD):/apps alpine/flake8:3.5.0 $(PYTHON_FILES)

0 comments on commit cfde16f

Please sign in to comment.