-
Notifications
You must be signed in to change notification settings - Fork 38
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
99 additions
and
26 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[flake8] | ||
# Default ignores that we can extend | ||
ignore=D100 | ||
max-line-length=120 |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: Lint code | ||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
- uses: pre-commit/action@v2.0.3 |
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,58 @@ | ||
minimum_pre_commit_version: "2.9.2" | ||
repos: | ||
- repo: meta | ||
hooks: | ||
- id: identity | ||
- id: check-hooks-apply | ||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: "" # Can not be removed, so leave this empty. | ||
hooks: | ||
- id: prettier | ||
- repo: local | ||
hooks: | ||
- id: no-relative-imports | ||
name: No relative imports. | ||
description: Use absolute imports only. | ||
entry: "^\\s*from\\s+\\." | ||
language: pygrep | ||
- id: isort | ||
name: iSort - Sorts imports. | ||
description: Sorts your import for you. | ||
entry: isort | ||
args: ["--settings-path=pyproject.toml"] | ||
language: python | ||
types: [python] | ||
require_serial: true | ||
additional_dependencies: | ||
- isort | ||
- id: black | ||
name: Black - Auto-formatter. | ||
description: Black is the uncompromising Python code formatter. Writing to files. | ||
entry: black | ||
args: ["--config=pyproject.toml"] | ||
language: python | ||
types: [python] | ||
require_serial: true | ||
additional_dependencies: | ||
- black | ||
- id: flake8 | ||
name: Flake8 - Enforce code style and doc. | ||
description: A command-line utility for enforcing style consistency across Python projects. | ||
entry: flake8 | ||
args: ["--config=.flake8"] | ||
language: python | ||
types: [python] | ||
require_serial: true | ||
additional_dependencies: | ||
- flake8 | ||
- flake8-docstrings | ||
- id: mypy | ||
name: mypy - Static type checking | ||
description: Mypy helps ensure that we use our functions and variables correctly by checking the types. | ||
entry: mypy | ||
args: ["--ignore-missing-imports", "--scripts-are-modules"] | ||
language: python | ||
types: [python] | ||
require_serial: true | ||
additional_dependencies: | ||
- mypy |
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,16 @@ | ||
[tool.black] | ||
line-length=120 | ||
target-version=['py36'] | ||
|
||
[tool.isort] | ||
line_length = 120 | ||
multi_line_output = 3 | ||
force_alphabetical_sort_within_sections = "True" | ||
force_sort_within_sections = "False" | ||
known_richclick = ["rich_click"] | ||
sections=["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER", "RICHCLICK"] | ||
profile = "black" | ||
|
||
[tool.mypy] | ||
python_version = "3.6" | ||
ignore_missing_imports = "True" |
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 |
---|---|---|
|
@@ -7,4 +7,7 @@ | |
"rich>=10", | ||
"importlib-metadata; python_version < '3.8'", | ||
], | ||
extras_require={ | ||
"dev": ["pre-commit"], | ||
}, | ||
) |