Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
356 changes: 128 additions & 228 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,267 +1,167 @@
repos:
- repo: https://github.com/mwouts/jupytext
rev: "v1.16.4b"
hooks:
- id: jupytext
entry: jupytext
language: python
types: [jupyter]
args:
- --from=ipynb
- --to=py:light
- --set-formats=ipynb,py:light
- --quiet
- --sync
- --warn-only
exclude: '.*\.md$'
- repo: https://github.com/PyCQA/docformatter
rev: "eb1df347edd128b30cd3368dddc3aa65edcfac38"
- repo: local
hooks:
- id: jupytext
name: jupytext
entry: python scripts/run_precommit_tool.py jupytext
language: system
require_serial: true
types: [jupyter]
args:
- --from=ipynb
- --to=py:light
- --set-formats=ipynb,py:light
- --quiet
- --sync
- --warn-only

- id: docformatter
args: [--in-place, --wrap-descriptions=120, --style=google]
- repo: https://github.com/psf/black.git
rev: "24.10.0"
hooks:
- id: black
name: docformatter
entry: python scripts/run_precommit_tool.py docformatter
language: system
require_serial: true
types: [python]
args:
- --in-place
- --wrap-descriptions=120
- --style=google

- repo: https://github.com/nbQA-dev/nbQA
rev: 1.9.0
hooks:
- id: nbqa-black
name: nbqa-black
description: Run 'black' on a Jupyter Notebook
entry: nbqa black
language: python
- id: black
name: black
entry: python scripts/run_precommit_tool.py black
language: system
require_serial: true
types_or: [jupyter, markdown]
additional_dependencies: [black]
- repo: https://github.com/asottile/pyupgrade
rev: "v3.19.0"
hooks:
- id: pyupgrade
args: [--py39-plus]
- repo: https://github.com/pycqa/isort
rev: "5.13.2"
hooks:
types: [python]

- id: isort
entry: isort
name: isort
entry: python scripts/run_precommit_tool.py isort
language: system
require_serial: true
types: [python]
args:
- --profile=black
- --profile=black
- --float-to-top

- repo: https://github.com/nbQA-dev/nbQA
rev: "1.9.0"
hooks:
- id: nbqa
entry: nbqa blacken-docs
name: nbqa-blacken-docs
alias: nbqa-blacken-docs
additional_dependencies: [blacken-docs]
- id: pyupgrade
name: pyupgrade
entry: python scripts/run_precommit_tool.py pyupgrade
language: system
require_serial: true
types: [python]
args:
- --nbqa-md
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.9.0
hooks:
- id: nbqa-pyupgrade
name: nbqa-pyupgrade
description: Run 'pyupgrade' on a Jupyter Notebook
entry: nbqa pyupgrade
language: python
- --py39-plus

- id: nbqa-black
name: nbqa-black
entry: python scripts/run_precommit_tool.py nbqa black
language: system
require_serial: true
types_or: [jupyter, markdown]
additional_dependencies: [pyupgrade]
types_or:
- jupyter
- markdown

- id: nbqa-isort
name: nbqa-isort
description: Run 'isort' on a Jupyter Notebook
entry: nbqa isort
language: python
entry: python scripts/run_precommit_tool.py nbqa isort
language: system
require_serial: true
types_or: [jupyter, markdown]
additional_dependencies: [isort]
args:
- --profile=black
- --float-to-top
types_or:
- jupyter
- markdown

- id: nbqa-pyupgrade
name: nbqa-pyupgrade
entry: python scripts/run_precommit_tool.py nbqa pyupgrade
language: system
require_serial: true
types_or:
- jupyter
- markdown

- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies:
- tomli
args:
- --ignore-regex=^\s*"image\/(jpeg|png|gif|bmp|tiff)":\s.*
- --ignore-regex=[A-Za-z0-9+/]{100,}
- --skip=*.js,*.html,*.css,*.svg",*.json,*.png,*.jpg,*.yml,*.yaml
exclude: '^python/makarov/|^python/oop\.ipynb$'
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.9.0
hooks:
- id: nbqa-flake8
args:
- --ignore=E501,E712,W291,F632,E203,F821,F403,W391,F401
- --exclude=.*,__init__.py
name: nbqa-flake8
description: Run 'flake8' on a Jupyter Notebook
entry: nbqa flake8
language: python
entry: python scripts/run_precommit_tool.py nbqa flake8
language: system
require_serial: true
types_or: [jupyter, markdown]
additional_dependencies:
- flake8-variables-names
- pep8-naming
- flake8-functions-names

- repo: https://github.com/PyCQA/flake8
rev: 7.1.1
hooks:
- id: flake8
types_or:
- jupyter
- markdown
args:
- --jobs=1
- --ignore=E501,E712,W291,F632,E203,F821,F403,W391,F401
- --exclude=.*,__init__.py
additional_dependencies:
- flake8-variables-names
- pep8-naming
- flake8-functions-names

- repo: https://github.com/nbQA-dev/nbQA
rev: 1.9.0
hooks:
- id: nbqa-mypy
name: nbqa-mypy
description: Run 'mypy' on a Jupyter Notebook
entry: nbqa mypy
language: python
- id: nbqa-pylint
name: nbqa-pylint
entry: python scripts/run_precommit_tool.py nbqa pylint
language: system
require_serial: true
types_or: [jupyter, markdown]
additional_dependencies:
- mypy==1.13.0
- pandas-stubs
- git+https://github.com/numpy/numpy-stubs
- mypy-extensions
- types-requests
- types-PyYAML
- types-setuptools

types_or:
- jupyter
- markdown
args:
# - --cache-dir=/dev/null
# - --cache-dir=nul
# - --no-incremental
- --non-interactive
- --install-types
- --explicit-package-bases
- --ignore-missing-imports
- --disallow-untyped-calls
- --disallow-untyped-defs
- --disallow-untyped-decorators
- --strict
- --extra-checks
- --disallow-any-decorated
- --disallow-any-generics
- --local-partial-types
- --pretty
- --force-uppercase-builtins
- --force-union-syntax
- --warn-unreachable
- --warn-redundant-casts
- --warn-return-any
- --disallow-any-explicit

- --max-line-length=120
- --disable=E0401,W0104,R0903,R1721,E1101,E0611,F0002,C0301,C0305,C0303,E2515

- id: nbqa-pydocstyle
name: nbqa-pydocstyle
entry: python scripts/run_precommit_tool.py nbqa pydocstyle
language: system
require_serial: true
types_or:
- jupyter
- markdown

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
hooks:
- id: mypy
- id: nbqa-mypy
name: nbqa-mypy
entry: python scripts/run_precommit_tool.py nbqa mypy
language: system
require_serial: true
types_or:
- jupyter
- markdown
args:
# - --cache-dir=/dev/null
# - --cache-dir=nul
# - --no-incremental
- --non-interactive
- --install-types
- --explicit-package-bases
- --cache-dir=nul
- --ignore-missing-imports
- --disallow-untyped-calls
- --disallow-untyped-defs
- --disallow-untyped-decorators
- --strict
- --extra-checks
- --disallow-any-decorated
- --disallow-any-generics
- --local-partial-types
- --pretty
- --force-uppercase-builtins
- --force-union-syntax
- --warn-unreachable
- --warn-redundant-casts
- --warn-return-any
- --disallow-any-explicit


additional_dependencies:
- mypy
- pandas-stubs
- git+https://github.com/numpy/numpy-stubs
- mypy-extensions
- types-requests
- types-PyYAML
- types-setuptools

- repo: https://github.com/nbQA-dev/nbQA
rev: 1.9.0
hooks:
- id: nbqa-pylint
name: nbqa-pylint
description: Run 'pylint' on a Jupyter Notebook
entry: nbqa pylint
language: python
- id: codespell
name: codespell
entry: python scripts/run_precommit_tool.py codespell_lib
language: system
require_serial: true
types_or: [jupyter, markdown]
additional_dependencies: [pylint]
args:
- --ignore=no_check*,__init__.py
- --max-line-length=120
- --const-naming-style=any
- --disable=E0401,W0104,R0903,R1721,E1101,E0611,F0002,C0305,C0303,E2515
- --ignore-regex=^\s*"image\/(jpeg|png|gif|bmp|tiff)":\s.*
- --ignore-regex=[A-Za-z0-9+/]{100,}
- --skip=*.js,*.html,*.css,*.svg,*.json,*.png,*.jpg,*.yml,*.yaml

- id: flake8
name: flake8
entry: python scripts/run_precommit_tool.py flake8
language: system
require_serial: true
types: [python]
args:
- --jobs=1
- --ignore=E501,E712,W291,F632,E203,F821,F403,W391,F401

- repo: https://github.com/pylint-dev/pylint
rev: "v3.3.1"
hooks:
- id: pylint
name: pylint
entry: pylint
language: python
entry: python scripts/run_precommit_tool.py pylint
language: system
require_serial: true
types: [python]
args:
[
"--ignore=no_check*,__init__.py",
"--max-line-length=120",
"--const-naming-style=any",
"--disable=E0401,W0104,R0903,R1721,E1101,E0611,F0002,C0305,line-too-long,C0303,E2515"
]
additional_dependencies: [pylint]
- --max-line-length=120
- --disable=E0401,W0104,R0903,R1721,E1101,F0002,C0301,C0305,C0303,E2515

- repo: https://github.com/nbQA-dev/nbQA
rev: 1.9.0
hooks:
- id: nbqa-pydocstyle
name: nbqa-pydocstyle
description: Run 'pydocstyle' on a Jupyter Notebook
entry: nbqa pydocstyle
language: python
- id: mypy
name: mypy
entry: python scripts/run_precommit_tool.py mypy
language: system
require_serial: true
types_or: [jupyter, markdown]
additional_dependencies: [pydocstyle]
# - repo: https://github.com/christophmeissner/pytest-pre-commit
# rev: 1.0.0
# hooks:
# - id: pytest
# name: "Run pytest with HTML report"
# entry: pytest
# args:
# - "--html=senatorov_report.html"
# - "--self-contained-html"
# language: python
# pass_filenames: false
# always_run: true
# additional_dependencies: [pytest-html]
types: [python]
args:
- --cache-dir=nul
- --ignore-missing-imports
- --strict
Loading
Loading