Skip to content

Commit ec08e66

Browse files
chore: add config / docs for 'pre-commit' support (googleapis#103)
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
1 parent 9397693 commit ec08e66

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

.pre-commit-config.yaml

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

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

synth.metadata

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
"git": {
55
"name": ".",
66
"remote": "https://github.com/googleapis/python-api-core.git",
7-
"sha": "fcf261fc3c4c1f28f2fa13d055716cf70d21f6f5"
7+
"sha": "93976931f231da6b42304bd117d8481067c55f6a"
88
}
99
},
1010
{
1111
"git": {
1212
"name": "synthtool",
1313
"remote": "https://github.com/googleapis/synthtool.git",
14-
"sha": "a073c873f3928c561bdf87fdfbf1d081d1998984"
14+
"sha": "32af6da519a6b042e3da62008e2a75e991efb6b4"
1515
}
1616
}
1717
],
@@ -58,6 +58,7 @@
5858
".kokoro/test-samples.sh",
5959
".kokoro/trampoline.sh",
6060
".kokoro/trampoline_v2.sh",
61+
".pre-commit-config.yaml",
6162
".trampolinerc",
6263
"CODE_OF_CONDUCT.md",
6364
"CONTRIBUTING.rst",

0 commit comments

Comments
 (0)