-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
58 additions
and
31 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 |
---|---|---|
@@ -1,20 +1,23 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: check-added-large-files # prevents adding large files | ||
- id: detect-private-key # detects private keys | ||
- id: fix-byte-order-marker # fixes BOM | ||
- id: fix-encoding-pragma # fixes encoding pragma | ||
- id: no-commit-to-branch # prevents committing to protected branches | ||
- id: trailing-whitespace # prevents trailing whitespace | ||
- repo: https://github.com/psf/black | ||
- id: check-added-large-files # prevents adding large files | ||
- id: detect-private-key # detects private keys | ||
- id: fix-byte-order-marker # fixes BOM | ||
- id: fix-encoding-pragma # fixes encoding pragma | ||
- id: no-commit-to-branch # prevents committing to protected branches | ||
- id: trailing-whitespace # prevents trailing whitespace | ||
- repo: https://github.com/psf/black | ||
rev: 23.9.1 | ||
hooks: | ||
- id: black | ||
|
||
- id: black | ||
exclude: 'pipelines\/\{\{cookiecutter\.project_name\}\}.*' | ||
- repo: https://github.com/PyCQA/flake8 | ||
- repo: https://github.com/PyCQA/autoflake | ||
rev: v2.2.1 | ||
hooks: | ||
- id: autoflake | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 6.1.0 | ||
hooks: | ||
- id: flake8 | ||
- id: flake8 |
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,13 @@ | ||
# Get the executables we're using | ||
POETRY=$(shell which poetry) | ||
PYTHON=$(shell poetry run which python) | ||
|
||
# `make install`: installs dependencies | ||
.PHONY: install | ||
install: | ||
$(POETRY) install | ||
|
||
# `make install`: installs pre-commit | ||
.PHONY: install_precommit | ||
install_precommit: | ||
$(POETRY) run pre-commit install --install-hooks |
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 |
---|---|---|
@@ -1,10 +1,17 @@ | ||
# -*- coding: utf-8 -*- | ||
from pylint.lint import Run | ||
from subprocess import run as _run | ||
|
||
|
||
def main(): | ||
Run(["pipelines/"]) | ||
def run(*args): | ||
process = _run(*args) | ||
return process.returncode | ||
|
||
|
||
if __name__ == "__main__": | ||
main() | ||
def main(): | ||
"""Lint all python files in the project""" | ||
code = 0 | ||
code |= run(["isort", "--check-only", "."]) | ||
code |= run(["black", "--check", "."]) | ||
code |= run(["autoflake", "--check", "--recursive", "--quiet", "."]) | ||
code |= run(["flake8", "."]) | ||
exit(code) |