From 80194b3e38bc75a3e9de61264db6fc4a5787f354 Mon Sep 17 00:00:00 2001 From: Blake Harnden <32446120+bharnden@users.noreply.github.com> Date: Tue, 14 Jul 2020 13:33:40 -0700 Subject: [PATCH] moved python black configuration to pyproject.toml and fixed bad exclude --- .github/workflows/daemon-checks.yml | 2 +- daemon/.pre-commit-config.yaml | 2 +- daemon/core/nodes/docker.py | 6 ++---- daemon/pyproject.toml | 5 +++++ 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/daemon-checks.yml b/.github/workflows/daemon-checks.yml index 5ea8d1c2..52440467 100644 --- a/.github/workflows/daemon-checks.yml +++ b/.github/workflows/daemon-checks.yml @@ -26,7 +26,7 @@ jobs: - name: black run: | cd daemon - poetry run black --check --exclude ".+_pb2.*.py|doc|build" . + poetry run black --check . - name: flake8 run: | cd daemon diff --git a/daemon/.pre-commit-config.yaml b/daemon/.pre-commit-config.yaml index fe810f04..bc9ead08 100644 --- a/daemon/.pre-commit-config.yaml +++ b/daemon/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: name: black stages: [commit] language: system - entry: bash -c 'cd daemon && poetry run black --exclude ".+_pb2.*.py|doc|build" .' + entry: bash -c 'cd daemon && poetry run black .' types: [python] - id: flake8 diff --git a/daemon/core/nodes/docker.py b/daemon/core/nodes/docker.py index 1ef814ee..ce34bd98 100644 --- a/daemon/core/nodes/docker.py +++ b/daemon/core/nodes/docker.py @@ -78,7 +78,7 @@ class DockerNode(CoreNode): name: str = None, nodedir: str = None, server: DistributedServer = None, - image: str = None + image: str = None, ) -> None: """ Create a DockerNode instance. @@ -209,9 +209,7 @@ class DockerNode(CoreNode): if self.server is not None: self.host_cmd(f"rm -f {temp.name}") os.unlink(temp.name) - logging.debug( - "node(%s) added file: %s; mode: 0%o", self.name, filename, mode - ) + logging.debug("node(%s) added file: %s; mode: 0%o", self.name, filename, mode) def nodefilecopy(self, filename: str, srcfilename: str, mode: int = None) -> None: """ diff --git a/daemon/pyproject.toml b/daemon/pyproject.toml index f7a9874a..3e37e4f9 100644 --- a/daemon/pyproject.toml +++ b/daemon/pyproject.toml @@ -39,6 +39,11 @@ force_grid_wrap = 0 use_parentheses = "True" line_length = 88 +[tool.black] +line_length = 88 +exclude = ".+_pb2.*.py|doc/|build/|__pycache__/" + + [build-system] requires = ["poetry>=0.12"] build-backend = "poetry.masonry.api"