-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Move pre-commit config to the top level of kedro-plugins (#259)
* Create .pre-commit-config.yaml * Update .pre-commit-config.yaml * remove pre-commit-config from each plugin * fix relative paths * add exclude regex * Update .pre-commit-config.yaml * rework pre-commit * test * Revert "test" This reverts commit edf731e. * Update Makefile * Update .pre-commit-config.yaml * Update .pre-commit-config.yaml * Update .pre-commit-config.yaml * Update .pre-commit-config.yaml * TEST * Update .pre-commit-config.yaml * fix isort * undo test * lint * add secret scan and bandit again * pass_filenames: true * Update check-plugin.yml * Revert "pass_filenames: true" This reverts commit 1e85806. * disable import errors * lint * Update .pre-commit-config.yaml * Update .pre-commit-config.yaml * isort * try running hooks seperatley * revert telemetry isort * fix ga yaml * Update check-plugin.yml * add hook stage * changes based on review * add features and tests for docker, airflow and telemetry * Update Makefile * indent * lint * lint for airflow and docker * Update check-plugin.yml * undo plugin lint
- Loading branch information
1 parent
e73d13b
commit 31b311e
Showing
7 changed files
with
227 additions
and
365 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,226 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
|
||
default_stages: [commit, manual] | ||
|
||
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. | ||
- 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. | ||
- id: requirements-txt-fixer # Sorts entries in requirements.txt | ||
- id: flake8 | ||
files: ^(kedro-datasets/kedro_datasets/|kedro-airflow/kedro_airflow/|kedro-docker/kedro_docker/|kedro-telemetry/kedro_telemetry/) | ||
args: | ||
- "--max-line-length=88" | ||
- "--max-complexity=18" | ||
- "--select=B,C,E,F,W,T4,B9" | ||
- "--ignore=E203,E266,E501,W503" | ||
exclude: "^kedro_airflow/dag_template.py|^template.py" | ||
|
||
- repo: local | ||
hooks: | ||
# pylint quick checks | ||
- id: pylint-quick-kedro-datasets | ||
name: "Quick PyLint on kedro_datasets/*" | ||
language: system | ||
types: [file, python] | ||
files: ^kedro-datasets/kedro_datasets/ | ||
exclude: ^(?!kedro-datasets/kedro_datasets/).*\.py$ | ||
entry: pylint --rcfile kedro-datasets/pyproject.toml --disable=unnecessary-pass | ||
stages: [commit] | ||
|
||
- id: pylint-quick-kedro-airflow | ||
name: "Quick PyLint on kedro_airflow/*" | ||
language: system | ||
types: [file, python] | ||
files: ^kedro-airflow/kedro_airflow/ | ||
exclude: ^(?!kedro-airflow/kedro_airflow/).*\.py$ | ||
entry: pylint --disable=unnecessary-pass | ||
stages: [commit] | ||
|
||
- id: pylint-quick-kedro-docker | ||
name: "Quick PyLint on kedro_docker/*" | ||
language: system | ||
types: [file, python] | ||
files: ^kedro-docker/kedro_docker/ | ||
exclude: ^(?!kedro-docker/kedro_docker/).*\.py$ | ||
entry: pylint --disable=unnecessary-pass | ||
stages: [commit] | ||
|
||
- id: pylint-quick-kedro-telemetry | ||
name: "Quick PyLint on kedro_telemetry/*" | ||
language: system | ||
types: [file, python] | ||
files: ^kedro-telemetry/kedro_telemetry/ | ||
exclude: ^(?!kedro-telemetry/kedro_telemetry/).*\.py$ | ||
entry: pylint --disable=unnecessary-pass | ||
stages: [commit] | ||
|
||
# pylint full checks | ||
- id: pylint-kedro-datasets | ||
name: "PyLint on kedro_datasets/*" | ||
language: system | ||
files: ^kedro-datasets/kedro_datasets/.*\.py$ | ||
exclude: ^(?!kedro-datasets/kedro_datasets/).*\.py$ | ||
pass_filenames: false | ||
stages: [manual] | ||
entry: pylint --rcfile kedro-datasets/pyproject.toml --disable=unnecessary-pass,E0401 kedro-datasets/kedro_datasets | ||
|
||
- id: pylint-kedro-datasets-features | ||
name: "PyLint on kedro-datasets features/*" | ||
language: system | ||
files: ^kedro-datasets/features/.*\.py$ | ||
exclude: ^(?!kedro-datasets/features/).*\.py$ | ||
pass_filenames: false | ||
stages: [manual] | ||
entry: pylint --rcfile kedro-datasets/pyproject.toml --disable=missing-docstring,no-name-in-module,E0401 kedro-datasets/features | ||
|
||
- id: pylint-kedro-datasets-tests | ||
name: "PyLint on kedro-datasets tests/*" | ||
language: system | ||
files: ^kedro-datasets/tests/.*\.py$ | ||
exclude: ^(?!kedro-datasets/tests/).*\.py$ | ||
pass_filenames: false | ||
stages: [manual] | ||
entry: pylint --rcfile kedro-datasets/pyproject.toml --disable=missing-docstring,redefined-outer-name,no-self-use,invalid-name,protected-access,too-many-arguments,E0401 kedro-datasets/tests | ||
|
||
- id: pylint-kedro-airflow | ||
name: "PyLint on kedro_airflow/*" | ||
language: system | ||
files: ^kedro-airflow/kedro_airflow/.*\.py$ | ||
exclude: ^(?!kedro-airflow/kedro_airflow/).*\.py$ | ||
pass_filenames: false | ||
stages: [manual] | ||
entry: pylint --disable=unnecessary-pass,E0401 kedro-airflow/kedro_airflow | ||
|
||
- id: pylint-kedro-airflow-features | ||
name: "PyLint on kedro-airflow features/*" | ||
language: system | ||
pass_filenames: false | ||
stages: [manual] | ||
entry: pylint --disable=missing-docstring,no-name-in-module kedro-airflow/features | ||
|
||
- id: pylint-kedro-airflow-tests | ||
name: "PyLint on kedro-airflow tests/*" | ||
language: system | ||
pass_filenames: false | ||
stages: [manual] | ||
entry: pylint --disable=missing-docstring,redefined-outer-name,no-self-use,invalid-name,protected-access,too-many-arguments kedro-airflow/tests | ||
|
||
- id: pylint-kedro-docker | ||
name: "PyLint on kedro_docker/*" | ||
language: system | ||
files: ^kedro-docker/kedro_docker/.*\.py$ | ||
exclude: ^(?!kedro-docker/kedro_docker/).*\.py$ | ||
pass_filenames: false | ||
stages: [manual] | ||
entry: pylint --disable=unnecessary-pass,E0401 kedro-docker/kedro_docker | ||
|
||
- id: pylint-kedro-docker-features | ||
name: "PyLint on kedro-docker features/*" | ||
language: system | ||
pass_filenames: false | ||
stages: [manual] | ||
entry: pylint --disable=missing-docstring,no-name-in-module kedro-docker/features | ||
|
||
- id: pylint-kedro-docker-tests | ||
name: "PyLint on kedro-docker tests/*" | ||
language: system | ||
pass_filenames: false | ||
stages: [manual] | ||
entry: pylint --disable=missing-docstring,redefined-outer-name,invalid-name,protected-access,too-many-arguments kedro-docker/tests | ||
|
||
- id: pylint-kedro-telemetry | ||
name: "PyLint on kedro_telemetry/*" | ||
language: system | ||
files: ^kedro-telemetry/kedro_telemetry/.*\.py$ | ||
exclude: ^(?!kedro-telemetry/kedro_telemetry/).*\.py$ | ||
pass_filenames: false | ||
stages: [manual] | ||
entry: pylint --disable=unnecessary-pass,E0401 kedro-telemetry/kedro_telemetry | ||
|
||
- id: pylint-kedro-telemetry-features | ||
name: "PyLint on kedro-docker features/*" | ||
language: system | ||
stages: [ manual ] | ||
entry: echo 'Not needed to run for this directory' | ||
files: .* | ||
|
||
- id: pylint-kedro-telemetry-tests | ||
name: "PyLint on kedro-telemetry tests/*" | ||
language: system | ||
pass_filenames: false | ||
stages: [manual] | ||
entry: pylint --disable=missing-docstring,redefined-outer-name,no-self-use,invalid-name,protected-access,too-many-arguments kedro-telemetry/tests | ||
|
||
- id: isort-kedro-datasets | ||
name: "Sort imports" | ||
language: system | ||
types: [ file, python ] | ||
files: ^kedro-datasets/ | ||
entry: isort | ||
|
||
- id: isort-kedro-docker | ||
name: "Sort imports" | ||
language: system | ||
types: [ file, python ] | ||
files: ^kedro-docker/ | ||
entry: isort | ||
|
||
- id: isort-kedro-airflow | ||
name: "Sort imports" | ||
language: system | ||
types: [ file, python ] | ||
files: ^kedro-airflow/ | ||
entry: isort | ||
|
||
- id: isort-kedro-telemetry | ||
name: "Sort imports" | ||
language: system | ||
types: [ file, python ] | ||
files: ^kedro-telemetry/ | ||
entry: isort | ||
|
||
- id: black-kedro-datasets | ||
name: "Black" | ||
language: system | ||
pass_filenames: false | ||
entry: black kedro-datasets/kedro_datasets kedro-datasets/features kedro-datasets/tests | ||
|
||
- id: black-kedro-docker | ||
name: "Black" | ||
language: system | ||
pass_filenames: false | ||
entry: black kedro-docker/kedro_docker kedro-docker/features kedro-docker/tests | ||
|
||
- id: black-kedro-airflow | ||
name: "Black" | ||
language: system | ||
pass_filenames: false | ||
entry: black kedro-airflow/kedro_airflow kedro-airflow/features kedro-airflow/tests | ||
|
||
- id: black-kedro-telemetry | ||
name: "Black" | ||
language: system | ||
pass_filenames: false | ||
entry: black kedro-telemetry/kedro_telemetry kedro-telemetry/tests | ||
|
||
- id: secret_scan | ||
name: "Secret scan" | ||
language: system | ||
pass_filenames: false | ||
entry: make secret-scan | ||
|
||
- id: bandit | ||
name: "Bandit security check" | ||
language: system | ||
types: [file, python] | ||
exclude: ^kedro-(telemetry|docker|datasets|airflow)/tests/|^kedro-(telemetry|docker|datasets|airflow)/features/ | ||
entry: bandit -ll |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.