Module: check_mk
Branch: master
Commit: 253b9fbba5612af85e3aec2708463aa4d4eabf8c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=253b9fbba5612a…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Tue May 29 15:19:20 2018 +0200
Added YAPF formatting.
Change-Id: I499d72fb2f51c2082f296cf9d64ec017c06694cc
---
.style.yapf | 5 +++++
tests/static/Makefile | 14 ++++++++++----
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/.style.yapf b/.style.yapf
new file mode 100644
index 0000000..1584e60
--- /dev/null
+++ b/.style.yapf
@@ -0,0 +1,5 @@
+[style]
+based_on_style=google
+blank_line_before_nested_class_or_def=False
+column_limit=100
+indent_dictionary_value=True
diff --git a/tests/static/Makefile b/tests/static/Makefile
index 83415ee..479ee2a 100644
--- a/tests/static/Makefile
+++ b/tests/static/Makefile
@@ -2,12 +2,18 @@ FILES_TO_CHECK := $(realpath $(addprefix ../../cmk/ec/,defaults.py
export.py set
MYPYPATH := $(realpath typeshed)
PIPENV := PIPENV_NO_INHERIT=true PIPENV_VENV_IN_PROJECT=true pipenv
-.PHONY: sanitize format-autopep8 test-mypy test-pylint
+.PHONY: sanitize format format-autopep8 format-yapf test-mypy test-pylint
-sanitize: format-autopep8 test-mypy test-pylint
+sanitize: format test-mypy test-pylint
+format: format-yapf
+
+# A bit ugly and sometimes breaks things, but let's keep it for comparison.
format-autopep8: .venv
- $(PIPENV) run autopep8 -i $(FILES_TO_CHECK)
+ $(PIPENV) run autopep8 -i $(FILES_TO_CHECK)
+
+format-yapf: .venv
+ $(PIPENV) run yapf -i $(FILES_TO_CHECK)
test-mypy: .venv
MYPYPATH="$(MYPYPATH)" $(PIPENV) run mypy --py2 --follow-imports=silent
--strict-optional $(FILES_TO_CHECK)
@@ -31,4 +37,4 @@ Pipfile.lock: Pipfile
touch .venv
clean:
- rm -rf .venv
+ rm -rf .mypy_cache .venv