-
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
7 changed files
with
945 additions
and
579 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
[flake8] | ||
ignore = E203,F401,F403,W503,E501,E266 | ||
exclude = | ||
*cookiecutter* | ||
max-line-length = 100 | ||
exclude = *cookiecutter* | ||
max-line-length = 100 |
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 |
Large diffs are not rendered by default.
Oops, something went wrong.
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,50 @@ | ||
# -*- 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", | ||
"--skip", | ||
"pipelines/{{cookiecutter.project_name}}", | ||
"--check-only", | ||
".", | ||
] | ||
) | ||
code |= run( | ||
[ | ||
"black", | ||
"--exclude", | ||
"pipelines/{{cookiecutter.project_name}}", | ||
"--check", | ||
".", | ||
] | ||
) | ||
code |= run( | ||
[ | ||
"autoflake", | ||
"--exclude", | ||
"pipelines/{{cookiecutter.project_name}}", | ||
"--check", | ||
"--recursive", | ||
"--quiet", | ||
".", | ||
] | ||
) | ||
code |= run( | ||
[ | ||
"flake8", | ||
"--exclude", | ||
"pipelines/{{cookiecutter.project_name}}", | ||
".", | ||
] | ||
) | ||
exit(code) |