Skip to content

Commit 67d529a

Browse files
chore: add config / docs for 'pre-commit' support (#38)
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>
1 parent db79577 commit 67d529a

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v3.2.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- repo: https://github.com/psf/black
11+
rev: 19.10b0
12+
hooks:
13+
- id: black
14+
- repo: https://gitlab.com/pycqa/flake8
15+
rev: 3.8.4
16+
hooks:
17+
- id: flake8

packages/google-cloud-access-approval/CONTRIBUTING.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,16 @@ Coding Style
111111
should point to the official ``googleapis`` checkout and the
112112
the branch should be the main branch on that remote (``master``).
113113

114+
- This repository contains configuration for the
115+
`pre-commit <https://pre-commit.com/>`__ tool, which automates checking
116+
our linters during a commit. If you have it installed on your ``$PATH``,
117+
you can enable enforcing those checks via:
118+
119+
.. code-block:: bash
120+
121+
$ pre-commit install
122+
pre-commit installed at .git/hooks/pre-commit
123+
114124
Exceptions to PEP8:
115125

116126
- Many unit tests use a helper method, ``_call_fut`` ("FUT" is short for

packages/google-cloud-access-approval/synth.metadata

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
"git": {
2020
"name": "synthtool",
2121
"remote": "https://github.com/googleapis/synthtool.git",
22-
"sha": "a073c873f3928c561bdf87fdfbf1d081d1998984"
22+
"sha": "32af6da519a6b042e3da62008e2a75e991efb6b4"
2323
}
2424
},
2525
{
2626
"git": {
2727
"name": "synthtool",
2828
"remote": "https://github.com/googleapis/synthtool.git",
29-
"sha": "a073c873f3928c561bdf87fdfbf1d081d1998984"
29+
"sha": "32af6da519a6b042e3da62008e2a75e991efb6b4"
3030
}
3131
}
3232
],
@@ -85,11 +85,13 @@
8585
".kokoro/test-samples.sh",
8686
".kokoro/trampoline.sh",
8787
".kokoro/trampoline_v2.sh",
88+
".pre-commit-config.yaml",
8889
".trampolinerc",
8990
"CODE_OF_CONDUCT.md",
9091
"CONTRIBUTING.rst",
9192
"LICENSE",
9293
"MANIFEST.in",
94+
"accessapproval-v1-py.tar.gz",
9395
"docs/_static/custom.css",
9496
"docs/_templates/layout.html",
9597
"docs/accessapproval_v1/services.rst",

0 commit comments

Comments
 (0)