From 96e9f26fd045c7dd22e72a9b66b78c3332c7ba97 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 30 Jun 2021 11:18:57 +0200 Subject: [PATCH] added linter --- lint.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 lint.py diff --git a/lint.py b/lint.py new file mode 100755 index 0000000..f0f66f0 --- /dev/null +++ b/lint.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 +import os +import sys + + +def main(): + status = os.system("flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics") + if os.WEXITSTATUS(status) != 0: + print("Flake8 linter errors") + sys.exit(0) + os.system("flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics") + + +if __name__ == "__main__": + main()