Use black for linting and formatting

This commit is contained in:
Christopher C. Wells 2022-02-09 16:03:31 -08:00
parent cd946280cb
commit ae7f9d5043
2 changed files with 12 additions and 2 deletions

View File

@ -25,7 +25,6 @@ whitenoise = "*"
[dev-packages]
coveralls = "*"
flake8 = "*"
ipaddress = "*"
mkdocs = "*"
mkdocs-material = "*"

View File

@ -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);