Skip to content

Commit

Permalink
Setup pre-commit styling
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhi committed Sep 28, 2021
1 parent e8eb9e8 commit 87d2825
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-docstring-first
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
hooks:
- id: flake8
additional_dependencies: [flake8-typing-imports==1.7.0]
- repo: https://github.com/myint/autoflake
rev: v1.4
hooks:
- id: autoflake
args: ["--in-place", "--remove-all-unused-imports", "--ignore-init-module-imports", "--remove-unused-variables"]
- repo: https://github.com/PyCQA/isort
rev: 5.8.0
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 21.5b2
hooks:
- id: black
- repo: https://github.com/asottile/pyupgrade
rev: v2.19.0
hooks:
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: 'v2.4.1'
hooks:
- id: prettier
types: [ts]

- repo: https://github.com/pre-commit/mirrors-eslint
rev: 'v7.32.0'
hooks:
- id: eslint
files: \.ts$ # *.ts
types: [file]
additional_dependencies:
- eslint
- typescript
- '@typescript-eslint/eslint-plugin'
- '@typescript-eslint/parser'
- 'eslint-config-prettier'
- 'eslint-plugin-prettier'
13 changes: 13 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,16 @@ norecursedirs = [
".ipynb_checkpoints",
]
addopts = "--nbval --current-env"

[tool.isort]
profile = "black"
src_paths = "ipympl"
multi_line_output = 3

[tool.pydocstyle]
match_dir = "ipympl"
convention = "numpy"
add_select = ["D402","D415","D417"]

[tool.black]
skip-string-normalization = true
8 changes: 8 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,11 @@ universal=1

[metadata]
license_file = LICENSE

[flake8]
exclude = docs, _version.py, .eggs, example
max-line-length = 88
docstring-convention = "numpy"
extend-ignore =
# See https://github.com/PyCQA/pycodestyle/issues/373
E203,

0 comments on commit 87d2825

Please sign in to comment.