diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 916b331e4..9162f4583 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,8 +3,8 @@ repos: hooks: - id: "codechecks" name: "codechecks" - stages: ["push"] + stages: ["pre-push"] language: "system" files: ".py$" entry: "tox -e codechecks" - pass_filenames: true + pass_filenames: false 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 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):