diff --git a/packages/google-cloud-access-approval/.pre-commit-config.yaml b/packages/google-cloud-access-approval/.pre-commit-config.yaml new file mode 100644 index 000000000000..fb80a95e88bb --- /dev/null +++ b/packages/google-cloud-access-approval/.pre-commit-config.yaml @@ -0,0 +1,17 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.2.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml +- repo: https://github.com/psf/black + rev: 19.10b0 + hooks: + - id: black +- repo: https://gitlab.com/pycqa/flake8 + rev: 3.8.4 + hooks: + - id: flake8 diff --git a/packages/google-cloud-access-approval/CONTRIBUTING.rst b/packages/google-cloud-access-approval/CONTRIBUTING.rst index 4aef11c3ae31..95226d2b5a6a 100644 --- a/packages/google-cloud-access-approval/CONTRIBUTING.rst +++ b/packages/google-cloud-access-approval/CONTRIBUTING.rst @@ -111,6 +111,16 @@ Coding Style should point to the official ``googleapis`` checkout and the the branch should be the main branch on that remote (``master``). +- This repository contains configuration for the + `pre-commit `__ tool, which automates checking + our linters during a commit. If you have it installed on your ``$PATH``, + you can enable enforcing those checks via: + +.. code-block:: bash + + $ pre-commit install + pre-commit installed at .git/hooks/pre-commit + Exceptions to PEP8: - Many unit tests use a helper method, ``_call_fut`` ("FUT" is short for diff --git a/packages/google-cloud-access-approval/synth.metadata b/packages/google-cloud-access-approval/synth.metadata index a43de519c156..037b446e4733 100644 --- a/packages/google-cloud-access-approval/synth.metadata +++ b/packages/google-cloud-access-approval/synth.metadata @@ -19,14 +19,14 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "a073c873f3928c561bdf87fdfbf1d081d1998984" + "sha": "32af6da519a6b042e3da62008e2a75e991efb6b4" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "a073c873f3928c561bdf87fdfbf1d081d1998984" + "sha": "32af6da519a6b042e3da62008e2a75e991efb6b4" } } ], @@ -85,11 +85,13 @@ ".kokoro/test-samples.sh", ".kokoro/trampoline.sh", ".kokoro/trampoline_v2.sh", + ".pre-commit-config.yaml", ".trampolinerc", "CODE_OF_CONDUCT.md", "CONTRIBUTING.rst", "LICENSE", "MANIFEST.in", + "accessapproval-v1-py.tar.gz", "docs/_static/custom.css", "docs/_templates/layout.html", "docs/accessapproval_v1/services.rst",