From 7953a9ca45ed4ecb68ee3d79e2bd1c9830b3c8f2 Mon Sep 17 00:00:00 2001 From: Christian Zangl Date: Mon, 7 Sep 2020 19:02:58 +0200 Subject: [PATCH] add black --- .travis.yml | 9 +++++++++ chkbit/index.py | 4 +++- chkbit/main.py | 18 ++++++++++++++---- 3 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..908c6fb --- /dev/null +++ b/.travis.yml @@ -0,0 +1,9 @@ +language: python +python: + - "3.6" + - "3.7" + - "3.8" +install: + - pip install black +script: + - black --check . diff --git a/chkbit/index.py b/chkbit/index.py index b7780d1..adbd0af 100644 --- a/chkbit/index.py +++ b/chkbit/index.py @@ -141,5 +141,7 @@ class Index: text = f.read() self.ignore = list( - filter(lambda x: x and x[0] != "#" and len(x.strip()) > 0, text.splitlines()) + filter( + lambda x: x and x[0] != "#" and len(x.strip()) > 0, text.splitlines() + ) ) diff --git a/chkbit/main.py b/chkbit/main.py index c2538e5..887b0fc 100644 --- a/chkbit/main.py +++ b/chkbit/main.py @@ -69,9 +69,14 @@ class Main: # ) parser.add_argument( - "-q", "--quiet", action="store_true", help="quiet, don't show progress/information" + "-q", + "--quiet", + action="store_true", + help="quiet, don't show progress/information", + ) + parser.add_argument( + "-v", "--verbose", action="store_true", help="verbose output" ) - parser.add_argument("-v", "--verbose", action="store_true", help="verbose output") self.args = parser.parse_args() self.verbose = self.args.verbose @@ -93,7 +98,9 @@ class Main: for path in self.args.PATH: todo_queue.put(path) - workers = [IndexThread(idx, self.args, self.res_queue, todo_queue) for idx in range(5)] + workers = [ + IndexThread(idx, self.args, self.res_queue, todo_queue) for idx in range(5) + ] res_worker = threading.Thread(target=self._res_worker) res_worker.daemon = True @@ -114,7 +121,10 @@ class Main: print("chkbit detected bitrot in these files:", file=sys.stderr) for err in self.bitrot_list: print(err, file=sys.stderr) - print(f"error: detected {len(self.bitrot_list)} file(s) with bitrot!", file=sys.stderr) + print( + f"error: detected {len(self.bitrot_list)} file(s) with bitrot!", + file=sys.stderr, + ) if self.err_list: print("chkbit ran into errors:", file=sys.stderr) for err in self.err_list: