From ae7f9d504330f2dcf40397beb39bd8f4ca2124f6 Mon Sep 17 00:00:00 2001 From: "Christopher C. Wells" Date: Wed, 9 Feb 2022 16:03:31 -0800 Subject: [PATCH] Use black for linting and formatting --- Pipfile | 1 - gulpfile.js | 13 ++++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index 5f44d727..65cf4750 100644 --- a/Pipfile +++ b/Pipfile @@ -25,7 +25,6 @@ whitenoise = "*" [dev-packages] coveralls = "*" -flake8 = "*" ipaddress = "*" mkdocs = "*" mkdocs-material = "*" diff --git a/gulpfile.js b/gulpfile.js index 036641e8..2b7d9cc1 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -145,13 +145,22 @@ function extras(cb) { ], cb); } +/** + * Runs Black formatting on Python code. + * + * @param cb + */ +function format(cb) { + _runInPipenv(['black', '.'], cb); +} + /** * Runs linting on Python and SASS code. * * @param cb */ function lint(cb) { - _runInPipenv(['flake8', '--exclude=.venv,etc,migrations,manage.py,node_modules,settings'], cb); + _runInPipenv(['black', '.', '--check', '--diff', '--color'], cb); pump([ gulp.src(config.watchConfig.stylesGlob), @@ -366,6 +375,8 @@ gulp.task('docs:watch', docsWatch); gulp.task('extras', extras); +gulp.task('format', format); + gulp.task('lint', lint); gulp.task('scripts', scripts);