forked from kedro-org/kedro
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[KED-901] Introduce pre-commit hooks and cheks (kedro-org#157)
- Loading branch information
Anton Kirilenko
authored
Aug 1, 2019
1 parent
0e453d0
commit 704cacb
Showing
34 changed files
with
230 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
|
||
default_stages: [commit, push] | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.2.3 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml # Checks yaml files for parseable syntax. | ||
exclude: "^kedro/template/" | ||
- id: check-json # Checks json files for parseable syntax. | ||
- id: check-added-large-files | ||
- id: check-case-conflict # Check for files that would conflict in case-insensitive filesystems | ||
- id: check-merge-conflict # Check for files that contain merge conflict strings. | ||
- id: debug-statements # Check for debugger imports and py37+ `breakpoint()` calls in python source. | ||
exclude: "^kedro/template/" | ||
- id: detect-private-key # Detects the presence of private keys | ||
- id: requirements-txt-fixer # Sorts entries in requirements.txt | ||
- id: flake8 | ||
exclude: "^kedro/template/" | ||
|
||
- repo: https://github.com/pre-commit/mirrors-isort | ||
rev: v4.3.21 | ||
hooks: | ||
- id: isort | ||
exclude: "^kedro/template/" | ||
|
||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v0.720 | ||
hooks: | ||
- id: mypy | ||
args: [--allow-redefinition, --ignore-missing-imports] | ||
exclude: | | ||
(?x)( | ||
^kedro/template/| | ||
^docs/ | ||
) | ||
- repo: local | ||
hooks: | ||
# It's impossible to specify per-directory configuration, so we just run it many times. | ||
# https://github.com/PyCQA/pylint/issues/618 | ||
- id: pylint-kedro | ||
name: "PyLint on kedro/*" | ||
language: system | ||
pass_filenames: false | ||
stages: [push] | ||
entry: pylint -j0 --disable=unnecessary-pass kedro | ||
- id: pylint-features | ||
name: "PyLint on features/*" | ||
language: system | ||
pass_filenames: false | ||
stages: [push] | ||
entry: pylint -j0 --disable=missing-docstring,no-name-in-module features | ||
- id: pylint-extras | ||
name: "PyLint on extras/*" | ||
language: system | ||
pass_filenames: false | ||
stages: [push] | ||
entry: pylint -j0 extras | ||
- id: pylint-tests | ||
name: "PyLint on tests/*" | ||
language: system | ||
pass_filenames: false | ||
stages: [push] | ||
entry: pylint -j0 --disable=missing-docstring,redefined-outer-name,no-self-use,invalid-name tests | ||
# We need to make some exceptions for 3.5, that's why it's a custom runner. | ||
- id: black | ||
name: "Black" | ||
language: system | ||
pass_filenames: false | ||
entry: python -m tools.black_runner kedro extras features tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,5 +26,3 @@ python: | |
extra_requirements: | ||
- docs | ||
- requirements: test_requirements.txt | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,4 +30,3 @@ kedro.pipeline | |
|
||
kedro.pipeline.decorators.log_time | ||
kedro.pipeline.decorators.mem_profile | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.