From 13e88c0c19dfb31c660ee167351ddd787c79241f Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Tue, 7 Jul 2020 17:16:39 -0700 Subject: [PATCH] Add Black to python build --- .pylintrc | 1 + Makefile | 2 ++ python/pyproject.toml | 4 +--- 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 .pylintrc diff --git a/.pylintrc b/.pylintrc new file mode 100644 index 00000000..334959e2 --- /dev/null +++ b/.pylintrc @@ -0,0 +1 @@ +max-line-length=88 \ No newline at end of file diff --git a/Makefile b/Makefile index b867d6de..b51d46d8 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,7 @@ js: generate-tests js/lib/*.js py: generate-tests $(BUILD_DIR)/python @echo Testing python beautify functionality... + $(SCRIPT_DIR)/python-dev black --config=python/pyproject.toml python $(SCRIPT_DIR)/python-dev python python/js-beautify-test.py || exit 1 jstest: depends js build/*.tgz @@ -129,6 +130,7 @@ $(BUILD_DIR)/virtualenv: | $(BUILD_DIR) virtualenv --version || pip install virtualenv virtualenv build/python-dev virtualenv build/python-rel + $(SCRIPT_DIR)/python-dev pip install black @touch $(BUILD_DIR)/virtualenv diff --git a/python/pyproject.toml b/python/pyproject.toml index 5fdd4242..fcc310a6 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -1,7 +1,5 @@ [tool.black] -line-length = 88 -target-version = ['py36', 'py37', 'py38'] -include = '\.pyi?$' +target-version = ['py27', 'py36', 'py37', 'py38'] exclude = ''' /( \.eggs