From e11a75abbe224590af68a4fbc68d61763130202a Mon Sep 17 00:00:00 2001 From: Chalmer Lowe Date: Wed, 28 Sep 2022 09:34:08 -0400 Subject: [PATCH] chore: updates blacken process to ensure all samples are processed (#1367) --- noxfile.py | 10 +++++++++- owlbot.py | 7 ++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index d9883d069..0b0800d35 100644 --- a/noxfile.py +++ b/noxfile.py @@ -25,7 +25,15 @@ MYPY_VERSION = "mypy==0.910" PYTYPE_VERSION = "pytype==2021.4.9" BLACK_VERSION = "black==22.3.0" -BLACK_PATHS = ("docs", "google", "samples", "tests", "noxfile.py", "setup.py") +BLACK_PATHS = ( + "docs", + "google", + "samples", + "samples/tests", + "tests", + "noxfile.py", + "setup.py", +) DEFAULT_PYTHON_VERSION = "3.8" SYSTEM_TEST_PYTHON_VERSIONS = ["3.8", "3.10"] diff --git a/owlbot.py b/owlbot.py index 4d287ac46..b887449ff 100644 --- a/owlbot.py +++ b/owlbot.py @@ -13,12 +13,15 @@ # limitations under the License. """This script is used to synthesize generated parts of this library.""" +from pathlib import Path import textwrap import synthtool as s from synthtool import gcp from synthtool.languages import python +REPO_ROOT = Path(__file__).parent.absolute() + default_version = "v2" for library in s.get_staging_dirs(default_version): @@ -120,4 +123,6 @@ ), ) -s.shell.run(["nox", "-s", "blacken"], hide_output=False) +# s.shell.run(["nox", "-s", "blacken"], hide_output=False) +for noxfile in REPO_ROOT.glob("samples/**/noxfile.py"): + s.shell.run(["nox", "-s", "blacken"], cwd=noxfile.parent, hide_output=False) \ No newline at end of file