-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from consideRatio/pr/add-pre-commit
maint: add pre-commit config
- Loading branch information
Showing
8 changed files
with
162 additions
and
28 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,13 @@ | ||
# flake8 is used for linting Python code setup to automatically run with | ||
# pre-commit. | ||
# | ||
# ref: https://flake8.pycqa.org/en/latest/user/configuration.html | ||
# | ||
|
||
[flake8] | ||
# E: style errors | ||
# W: style warnings | ||
# C: complexity | ||
# D: docstring warnings (unused pydocstyle extension) | ||
# F841: local variable assigned but never used | ||
ignore = E, C, W, D, F841 |
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,77 @@ | ||
# pre-commit is a tool to perform a predefined set of tasks manually and/or | ||
# automatically before git commits are made. | ||
# | ||
# Config reference: https://pre-commit.com/#pre-commit-configyaml---top-level | ||
# | ||
# Common tasks | ||
# | ||
# - Run on all files: pre-commit run --all-files | ||
# - Register git hooks: pre-commit install --install-hooks | ||
# | ||
repos: | ||
# Autoformat: Python code, syntax patterns are modernized | ||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v3.3.1 | ||
hooks: | ||
- id: pyupgrade | ||
args: | ||
- --py38-plus | ||
|
||
# Autoformat: Python code | ||
- repo: https://github.com/PyCQA/autoflake | ||
rev: v2.0.0 | ||
hooks: | ||
- id: autoflake | ||
# args ref: https://github.com/PyCQA/autoflake#advanced-usage | ||
args: | ||
- --in-place | ||
|
||
# Autoformat: Python code | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.11.4 | ||
hooks: | ||
- id: isort | ||
|
||
# Autoformat: Python code | ||
- repo: https://github.com/psf/black | ||
rev: 22.12.0 | ||
hooks: | ||
- id: black | ||
|
||
# Autoformat: markdown, yaml | ||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: v3.0.0-alpha.4 | ||
hooks: | ||
- id: prettier | ||
|
||
# Misc... | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
# ref: https://github.com/pre-commit/pre-commit-hooks#hooks-available | ||
hooks: | ||
# Autoformat: Makes sure files end in a newline and only a newline. | ||
- id: end-of-file-fixer | ||
|
||
# Autoformat: Sorts entries in requirements.txt. | ||
- id: requirements-txt-fixer | ||
|
||
# Lint: Check for files with names that would conflict on a | ||
# case-insensitive filesystem like MacOS HFS+ or Windows FAT. | ||
- id: check-case-conflict | ||
|
||
# Lint: Checks that non-binary executables have a proper shebang. | ||
- id: check-executables-have-shebangs | ||
|
||
# Lint: Python code | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: "6.0.0" | ||
hooks: | ||
- id: flake8 | ||
|
||
# Content here is mostly copied from other locations, so lets not make | ||
# formatting changes in it. | ||
exclude: share | ||
|
||
# pre-commit.ci config reference: https://pre-commit.ci/#configuration | ||
ci: | ||
autoupdate_schedule: monthly |
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 +1 @@ | ||
graft jupyter_remote_desktop_proxy/share | ||
graft jupyter_remote_desktop_proxy/share |
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,35 @@ | ||
# autoflake is used for autoformatting Python code | ||
# | ||
# ref: https://github.com/PyCQA/autoflake#readme | ||
# | ||
[tool.autoflake] | ||
ignore-init-module-imports = true | ||
remove-all-unused-imports = true | ||
remove-duplicate-keys = true | ||
remove-unused-variables = true | ||
|
||
|
||
# isort is used for autoformatting Python code | ||
# | ||
# ref: https://pycqa.github.io/isort/ | ||
# | ||
[tool.isort] | ||
profile = "black" | ||
|
||
|
||
# black is used for autoformatting Python code | ||
# | ||
# ref: https://black.readthedocs.io/en/stable/ | ||
# | ||
[tool.black] | ||
skip-string-normalization = true | ||
# target-version should be all supported versions, see | ||
# https://github.com/psf/black/issues/751#issuecomment-473066811 | ||
target_version = [ | ||
"py36", | ||
"py37", | ||
"py38", | ||
"py39", | ||
"py310", | ||
"py311", | ||
] |
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