diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3fafd07 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +__pycache__ +*.egg-info diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7185627..8fe61fc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,38 +1,50 @@ repos: + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.1.2 + hooks: + - id: ruff + - id: ruff-format + - repo: https://github.com/Lucas-C/pre-commit-hooks + rev: v1.5.4 + hooks: + - id: forbid-tabs + - repo: https://github.com/pappasam/toml-sort + rev: v0.23.1 + hooks: + - id: toml-sort-fix + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.6.1 + hooks: + - id: mypy + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v3.0.3 + hooks: + - id: prettier - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.5.0 hooks: - id: check-case-conflict + - id: check-docstring-first - id: check-merge-conflict + - id: check-toml + - id: check-yaml - id: end-of-file-fixer - id: mixed-line-ending args: - --fix=lf - id: trailing-whitespace - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.0.3 - hooks: - - id: prettier - - repo: https://github.com/renovatebot/pre-commit-hooks - rev: 37.33.6 - hooks: - - id: renovate-config-validator - args: - - renovate/default-config.json - repo: https://github.com/codespell-project/codespell rev: v2.2.6 hooks: - id: codespell - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.2 - hooks: - - id: ruff - args: - - --exit-non-zero-on-fix - - --fix - - id: ruff-format - repo: https://github.com/python-jsonschema/check-jsonschema rev: 0.27.0 hooks: - id: check-github-actions - id: check-github-workflows + - repo: https://github.com/renovatebot/pre-commit-hooks + rev: 37.33.6 + hooks: + - id: renovate-config-validator + args: + - renovate/default-config.json diff --git a/precommit/python/python-hooks.yml b/precommit/python/python-hooks.yml index 49b223d..1dff473 100644 --- a/precommit/python/python-hooks.yml +++ b/precommit/python/python-hooks.yml @@ -16,6 +16,11 @@ repos: rev: v1.6.1 hooks: - id: mypy + additional_dependencies: + # for this bit to work this repo includes a pyproject.toml, without + # which these dependencies would not be installed + - numpy + - pydantic - repo: https://github.com/pre-commit/mirrors-prettier rev: v3.0.3 hooks: @@ -27,6 +32,7 @@ repos: - id: check-docstring-first - id: check-merge-conflict - id: check-toml + - id: check-yaml - id: end-of-file-fixer - id: mixed-line-ending args: diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..6fc2b53 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,21 @@ +[project] +authors = [ + {email = "patrickjamesroddy@gmail.com", name = "Patrick J. Roddy"}, +] +description = """ +This file is only present as the additional_dependencies in pre-commit require a +setup.py or pyproject.toml, otherwise it will not install them +""" +name = "pre_commit_placeholder_package" +readme = "README.md" +version = "0.0.0" +license.file = "README.md" + +[tool.ruff] +fix = true +force-exclude = true + +[tool.tomlsort] +all = true +spaces_indent_inline_array = 4 +trailing_comma_inline_array = true