From d55b8f1e53baba20efe62ce9149b0ae7e2d601ba Mon Sep 17 00:00:00 2001 From: JW Jacobson <116485484+jwjacobson@users.noreply.github.com> Date: Tue, 22 Oct 2024 11:45:24 -0400 Subject: [PATCH 1/6] Add a file that violates flake8 --- src/allmydata/undefined_name.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/allmydata/undefined_name.py diff --git a/src/allmydata/undefined_name.py b/src/allmydata/undefined_name.py new file mode 100644 index 000000000..417b7b537 --- /dev/null +++ b/src/allmydata/undefined_name.py @@ -0,0 +1 @@ +undefined From fd28160421f1b031886cbc2e53729d1f82ef608c Mon Sep 17 00:00:00 2001 From: JW Jacobson <116485484+jwjacobson@users.noreply.github.com> Date: Mon, 4 Nov 2024 11:31:45 -0500 Subject: [PATCH 2/6] WIP 1101 Add verbose flag to check command This commit adds the verbose option to the command 'check' so that if you choose verbose, you do not get an error message. The full verbose output is not yet implemented. When verbose is fully supported, the option should return more detailed output. modified: src/allmydata/scripts/cli.py modified: src/allmydata/test/cli/test_check.py --- src/allmydata/scripts/cli.py | 1 + src/allmydata/test/cli/test_check.py | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/allmydata/scripts/cli.py b/src/allmydata/scripts/cli.py index 6e1f28d11..df0d0be1c 100644 --- a/src/allmydata/scripts/cli.py +++ b/src/allmydata/scripts/cli.py @@ -445,6 +445,7 @@ class CheckOptions(FileStoreOptions): ("verify", None, "Verify all hashes, instead of merely querying share presence."), ("repair", None, "Automatically repair any problems found."), ("add-lease", None, "Add/renew lease on all shares."), + ("verbose", None, "Provide verbose output (unimplemented)."), ] def parseArgs(self, *locations): self.locations = list(map(argv_to_unicode, locations)) diff --git a/src/allmydata/test/cli/test_check.py b/src/allmydata/test/cli/test_check.py index c895451ea..08e80374d 100644 --- a/src/allmydata/test/cli/test_check.py +++ b/src/allmydata/test/cli/test_check.py @@ -151,6 +151,18 @@ class Check(GridTestMixin, CLITestMixin, unittest.TestCase): self.failIf(" corrupt shares:" in lines, out) d.addCallback(_check5) + # Testing verbose option + d.addCallback(lambda ign: self.do_cli("check", "--verbose", self.uri)) + def _check6(args): + (rc, out, err) = args + self.assertEqual(len(err), 0, err) + self.failUnlessReallyEqual(rc, 0) + lines = out.splitlines() + self.failUnless("Summary: Healthy" in lines, out) + self.failUnless(" good-shares: 10 (encoding is 3-of-10)" in lines, out) + d.addCallback(_check1) + + return d def test_deep_check(self): From 0c76148cafa24a9654e35b86d978acc19415e01d Mon Sep 17 00:00:00 2001 From: JW Jacobson <116485484+jwjacobson@users.noreply.github.com> Date: Mon, 4 Nov 2024 12:03:11 -0500 Subject: [PATCH 3/6] Migrate precommit config to new stage settings --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 916b331e4..165404a76 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ repos: hooks: - id: "codechecks" name: "codechecks" - stages: ["push"] + stages: ["pre-push"] language: "system" files: ".py$" entry: "tox -e codechecks" From 38a09714049624570ba10994fb32d6dafc453150 Mon Sep 17 00:00:00 2001 From: JW Jacobson <116485484+jwjacobson@users.noreply.github.com> Date: Mon, 4 Nov 2024 12:13:13 -0500 Subject: [PATCH 4/6] Add newsfragment --- newsfragments/1101.feature | 1 + 1 file changed, 1 insertion(+) create mode 100644 newsfragments/1101.feature diff --git a/newsfragments/1101.feature b/newsfragments/1101.feature new file mode 100644 index 000000000..8b9d5edb8 --- /dev/null +++ b/newsfragments/1101.feature @@ -0,0 +1 @@ +Adding support for --verbose option \ No newline at end of file From 0f2b5c48f7495a5d3f6219ca4946956eff3cf795 Mon Sep 17 00:00:00 2001 From: JW Jacobson <116485484+jwjacobson@users.noreply.github.com> Date: Mon, 4 Nov 2024 12:15:18 -0500 Subject: [PATCH 5/6] Remove undefined_name from git --- src/allmydata/undefined_name.py | 1 - 1 file changed, 1 deletion(-) delete mode 100644 src/allmydata/undefined_name.py diff --git a/src/allmydata/undefined_name.py b/src/allmydata/undefined_name.py deleted file mode 100644 index 417b7b537..000000000 --- a/src/allmydata/undefined_name.py +++ /dev/null @@ -1 +0,0 @@ -undefined From d7f520bff1158fd9c7844c87bb69a4f82560d87e Mon Sep 17 00:00:00 2001 From: JW Jacobson <116485484+jwjacobson@users.noreply.github.com> Date: Fri, 29 Nov 2024 15:34:47 -0500 Subject: [PATCH 6/6] Revert precommit yaml to previous state --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 165404a76..9162f4583 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,4 +7,4 @@ repos: language: "system" files: ".py$" entry: "tox -e codechecks" - pass_filenames: true + pass_filenames: false