Skip to content

Commit

Permalink
Add pre-commit hook for pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
chadrik committed Mar 10, 2020
1 parent e593074 commit d949bc4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

default_language_version:
python: python3.7
repos:
- repo: https://github.com/pre-commit/mirrors-yapf
# this rev is a release tag in the repo above and corresponds with a yapf
Expand All @@ -18,8 +20,8 @@ repos:
hooks:
- id: yapf
files: ^sdks/python/apache_beam/
# keep these in sync with sdks/python/.yapfignore
exclude: >
# keep these in sync with sdks/python/.yapfignore and run_pylint.sh
exclude: &exclude >
(?x)^(
sdks/python/apache_beam/io/gcp/internal/clients/bigquery/bigquery_v2_client.py|
sdks/python/apache_beam/io/gcp/internal/clients/bigquery/bigquery_v2_messages.py|
Expand All @@ -30,3 +32,13 @@ repos:
sdks/python/apache_beam/coders/proto2_coder_test_messages_pb2.py|
sdks/python/apache_beam/portability/api/.*pb2.*.py
)$

- repo: https://github.com/pycqa/pylint
# this rev is a release tag in the repo above and corresponds with a pylint
# version. make sure this matches the version of pylint in tox.ini.
rev: pylint-2.4.3
hooks:
- id: pylint
args: ["--rcfile=sdks/python/.pylintrc"]
files: ^sdks/python/apache_beam/
exclude: *exclude
1 change: 1 addition & 0 deletions sdks/python/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ commands =
[testenv:py37-lint]
# Don't set TMPDIR to avoid "AF_UNIX path too long" errors in pylint.
setenv =
# keep the version of pylint in sync with the 'rev' in .pre-commit-config.yaml
deps =
-r build-requirements.txt
astroid<2.4,>=2.3.0
Expand Down

0 comments on commit d949bc4

Please sign in to comment.