diff --git a/Pipfile b/Pipfile index 4b26a71a..ab2eb6f6 100644 --- a/Pipfile +++ b/Pipfile @@ -10,3 +10,4 @@ django-widget-tweaks = "*" [dev-packages] faker = "*" +flake8 = "*" diff --git a/Pipfile.lock b/Pipfile.lock index 802e166b..66f4768f 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "837c05c254d8603c80ce3add8dfd5e9a80701a742fdd1b98568f1b664586870f" + "sha256": "547b11caae0d9c3ca69111553ae252eaae921249de5f2bce48bb3eb59b61d853" }, "requires": {}, "sources": [ @@ -22,7 +22,7 @@ "version": "==1.4.1" }, "djangorestframework": { - "version": "==3.6.3" + "version": "==3.6.4" }, "pytz": { "version": "==2017.2" @@ -32,6 +32,18 @@ "faker": { "version": "==0.7.18" }, + "flake8": { + "version": "==3.4.1" + }, + "mccabe": { + "version": "==0.6.1" + }, + "pycodestyle": { + "version": "==2.3.1" + }, + "pyflakes": { + "version": "==1.5.0" + }, "python-dateutil": { "version": "==2.6.1" }, diff --git a/gulpfile.js/tasks/lint.js b/gulpfile.js/tasks/lint.js index 445fbddb..b114a093 100644 --- a/gulpfile.js/tasks/lint.js +++ b/gulpfile.js/tasks/lint.js @@ -2,11 +2,26 @@ var gulp = require('gulp'); var sassLint = require('gulp-sass-lint'); var pump = require('pump'); +var spawn = require('child_process').spawn; var watchConfig = require('../config.js').watchConfig; -gulp.task('lint', ['lint:styles']); +gulp.task('lint', ['lint:styles', 'lint:python']); + +gulp.task('lint:python', function(cb) { + spawn( + 'pipenv', + [ + 'run', + 'flake8', + '--exclude=node_modules,migrations' + ], + { + stdio: 'inherit' + } + ).on('exit', cb); +}); gulp.task('lint:styles', function(cb) { pump([ diff --git a/package.json b/package.json index d8b2bba0..3262b25f 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "gulp-sass": "^3.1.0", "gulp-sass-glob": "^1.0.8", "gulp-sass-lint": "^1.3.2", + "gulp-spawn": "^0.4.0", "gulp-uglify": "^3.0.0", "jquery": "^3.2.1", "moment": "^2.18.1",