Skip to content

Commit

Permalink
add pre-commit config
Browse files Browse the repository at this point in the history
  • Loading branch information
rkm committed Feb 15, 2024
1 parent 971733e commit 5f7e4ad
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 0 deletions.
Empty file added .meta/codespell-excludes
Empty file.
1 change: 1 addition & 0 deletions .meta/codespell-ignores
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ot
10 changes: 10 additions & 0 deletions .meta/markdown-link-check.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"ignorePatterns": [
],
"replacementPatterns": [
{
"pattern": "^/",
"replacement": "{{BASEURL}}/"
}
]
}
20 changes: 20 additions & 0 deletions .meta/mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[mypy]
check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true

[mypy-SmiServices.*]
ignore_missing_imports = True

[mypy-pydal.*]
ignore_missing_imports = True

[mypy-PySimpleGUI.*]
ignore_missing_imports = True

[mypy-PySimpleGUIQt.*]
ignore_missing_imports = True
2 changes: 2 additions & 0 deletions .meta/yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rules:
braces: { min-spaces-inside: 1, max-spaces-inside: 1 }
104 changes: 104 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
exclude: |
(?x)^(
src/data/mtsamples_ihi.*|
)$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
# General
- id: check-added-large-files
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-xml
- id: check-yaml
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
# Python
- id: check-ast
- id: check-builtin-literals
- id: check-docstring-first
- id: debug-statements
- id: name-tests-test
- id: requirements-txt-fixer
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes
- repo: https://github.com/rkm/pre-commit-nocommit
rev: "v1.0.0"
hooks:
- id: nocommit
exclude: |
(?x)^(
.pre-commit-config.yaml|
)$
- repo: https://github.com/codespell-project/codespell
rev: "v2.2.6"
hooks:
- id: codespell
args:
[
--ignore-words,
.meta/codespell-ignores,
--exclude-file,
.meta/codespell-excludes,
]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.1.0"
hooks:
- id: prettier
# Markdown
- repo: https://github.com/tcort/markdown-link-check
rev: "v3.11.2"
hooks:
- id: markdown-link-check
args: [--quiet, --config, .meta/markdown-link-check.json]
# YAML
- repo: https://github.com/adrienverge/yamllint
rev: "v1.35.0"
hooks:
- id: yamllint
args: [-c, .meta/yamllint.yaml]
# Python
- repo: https://github.com/pre-commit/pygrep-hooks
rev: "v1.10.0"
hooks:
- id: python-check-blanket-noqa
- id: python-check-mock-methods
- id: python-use-type-annotations
- id: python-no-log-warn
- repo: https://github.com/asottile/reorder_python_imports
rev: "v3.12.0"
hooks:
- id: reorder-python-imports
args: [--py310-plus]
- repo: https://github.com/asottile/add-trailing-comma
rev: "v3.1.0"
hooks:
- id: add-trailing-comma
- repo: https://github.com/asottile/pyupgrade
rev: "v3.15.0"
hooks:
- id: pyupgrade
args: [--py310-plus]
- repo: https://github.com/asottile/yesqa
rev: "v1.5.0"
hooks:
- id: yesqa
additional_dependencies: [pep8-naming]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.8.0"
hooks:
- id: mypy
args: [--config-file, .meta/mypy.ini]
additional_dependencies: [pydicom]
- repo: https://github.com/psf/black-pre-commit-mirror
rev: "24.2.0"
hooks:
- id: black
language_version: python310

0 comments on commit 5f7e4ad

Please sign in to comment.