From 6e0dc39a6caf3b8417a5491e9683fcc721dcabfd Mon Sep 17 00:00:00 2001 From: isms Date: Mon, 2 Nov 2015 09:02:49 -0500 Subject: [PATCH] Add flake8 linting --- {{ cookiecutter.repo_name }}/Makefile | 23 ++++++++++++++++--- {{ cookiecutter.repo_name }}/requirements.txt | 1 + {{ cookiecutter.repo_name }}/tox.ini | 3 +++ 3 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 {{ cookiecutter.repo_name }}/tox.ini diff --git a/{{ cookiecutter.repo_name }}/Makefile b/{{ cookiecutter.repo_name }}/Makefile index 8ced684..7717b4d 100644 --- a/{{ cookiecutter.repo_name }}/Makefile +++ b/{{ cookiecutter.repo_name }}/Makefile @@ -1,4 +1,14 @@ -.PHONY: clean data requirements sync_data_to_s3 sync_data_from_s3 +.PHONY: clean data lint requirements sync_data_to_s3 sync_data_from_s3 + +################################################################################# +# GLOBALS # +################################################################################# + +BUCKET = {{ cookiecutter.s3_bucket }} + +################################################################################# +# COMMANDS # +################################################################################# requirements: pip install -r requirements.txt @@ -9,8 +19,15 @@ data: requirements clean: find . -name "*.pyc" -exec rm {} \; +lint: + flake8 . + sync_data_to_s3: - s3cmd sync --recursive data/ s3://{{ cookiecutter.s3_bucket }}/data/ + s3cmd sync --recursive data/ s3://$( BUCKET )/data/ sync_data_from_s3: - s3cmd sync --recursive s3://{{ cookiecutter.s3_bucket }}/data/ data/ + s3cmd sync --recursive s3://$( BUCKET )/data/ data/ + +################################################################################# +# PROJECT RULES # +################################################################################# diff --git a/{{ cookiecutter.repo_name }}/requirements.txt b/{{ cookiecutter.repo_name }}/requirements.txt index 01389e2..8ac80e4 100644 --- a/{{ cookiecutter.repo_name }}/requirements.txt +++ b/{{ cookiecutter.repo_name }}/requirements.txt @@ -2,3 +2,4 @@ click Sphinx coverage s3cmd==1.6.0 +flake8 \ No newline at end of file diff --git a/{{ cookiecutter.repo_name }}/tox.ini b/{{ cookiecutter.repo_name }}/tox.ini new file mode 100644 index 0000000..c32fbd8 --- /dev/null +++ b/{{ cookiecutter.repo_name }}/tox.ini @@ -0,0 +1,3 @@ +[flake8] +max-line-length = 79 +max-complexity = 10