Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
chore: add pre-commit hook (#60)
Browse files Browse the repository at this point in the history
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/af4e17c6-27a1-40de-9cfc-4abd9fb801f3/targets

- [ ] To automatically regenerate this PR, check this box.

Source-Link: googleapis/synthtool@aa255b1
Source-Link: googleapis/synthtool@f943185
Source-Link: googleapis/synthtool@69629b6
Source-Link: googleapis/synthtool@32af6da
  • Loading branch information
yoshi-automation committed Dec 16, 2020
1 parent 61d2c7b commit 545e479
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 5 deletions.
17 changes: 17 additions & 0 deletions .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.4.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 CONTRIBUTING.rst
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
5 changes: 2 additions & 3 deletions noxfile.py
Expand Up @@ -81,9 +81,8 @@ def default(session):
session.run(
"py.test",
"--quiet",
"--cov=google.cloud.recommender",
"--cov=google.cloud",
"--cov=tests.unit",
"--cov=google/cloud",
"--cov=tests/unit",
"--cov-append",
"--cov-config=.coveragerc",
"--cov-report=",
Expand Down
5 changes: 3 additions & 2 deletions synth.metadata
Expand Up @@ -19,14 +19,14 @@
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "68742c6016bf0d16948a572633d17955a8737414"
"sha": "aa255b15d52b6d8950cca48cfdf58f7d27a60c8a"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "68742c6016bf0d16948a572633d17955a8737414"
"sha": "aa255b15d52b6d8950cca48cfdf58f7d27a60c8a"
}
}
],
Expand Down Expand Up @@ -94,6 +94,7 @@
".kokoro/test-samples.sh",
".kokoro/trampoline.sh",
".kokoro/trampoline_v2.sh",
".pre-commit-config.yaml",
".trampolinerc",
"CODE_OF_CONDUCT.md",
"CONTRIBUTING.rst",
Expand Down

0 comments on commit 545e479

Please sign in to comment.