Skip to content

Commit

Permalink
chore: add config / docs for 'pre-commit' support (#38)
Browse files Browse the repository at this point in the history
Source-Author: Tres Seaver <tseaver@palladion.com>
Source-Date: Tue Dec 1 16:01:20 2020 -0500
Source-Repo: googleapis/synthtool
Source-Sha: 32af6da519a6b042e3da62008e2a75e991efb6b4
Source-Link: googleapis/synthtool@32af6da

Co-authored-by: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com>
  • Loading branch information
yoshi-automation and busunkim96 authored Dec 29, 2020
1 parent db79577 commit 67d529a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
17 changes: 17 additions & 0 deletions packages/google-cloud-access-approval/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions packages/google-cloud-access-approval/CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://pre-commit.com/>`__ 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
Expand Down
6 changes: 4 additions & 2 deletions packages/google-cloud-access-approval/synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
],
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 67d529a

Please sign in to comment.