From 06dd877cbf656a3d97e9e0c2b0cbaca9794f10eb Mon Sep 17 00:00:00 2001 From: Manuel Barkhau Date: Tue, 23 Jul 2019 20:19:42 +0200 Subject: [PATCH] use sjfmt --check in lint step --- makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index cd5581f..12d89b6 100644 --- a/makefile +++ b/makefile @@ -78,6 +78,9 @@ GIT_HEAD_REV = $(shell git rev-parse --short HEAD) DOCKER_IMAGE_VERSION = $(shell date -u +'%Y%m%dt%H%M%S')_$(GIT_HEAD_REV) +MAX_LINE_LEN = $(shell grep 'max-line-length = 100' setup.cfg | grep -oE "[0-9]+") + + build/envs.txt: requirements/conda.txt @mkdir -p build/; @@ -306,6 +309,14 @@ lint: @printf "flake8 ..\n" @$(DEV_ENV)/bin/flake8 src/ @printf "\e[1F\e[9C ok\n" + @printf "sjfmt ..\n" + @$(DEV_ENV)/bin/sjfmt \ + --target-version=py36 \ + --skip-string-normalization \ + --line-length=$(MAX_LINE_LEN) \ + --check \ + src/ test/ 2>&1 | sed "/All done/d" | sed "/left unchanged/d" + @printf "\e[1F\e[9C ok\n" ## Run mypy type checker @@ -367,7 +378,7 @@ fmt: @$(DEV_ENV)/bin/sjfmt \ --target-version=py36 \ --skip-string-normalization \ - --line-length=100 \ + --line-length=$(MAX_LINE_LEN) \ src/ test/