Skip to content

Commit

Permalink
Add pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss committed Sep 2, 2024
1 parent 1d63ea6 commit bbbac2c
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,19 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: 3.11
# - uses: pre-commit/[email protected]
- run: pip install pipenv ruff
- run: ruff check --exit-zero --output-format=github --target-version=py311
- run: pip install pipenv
- run: pipenv install --dev
- name: Versions
run: |
python3 --version
echo "Node.js $(node --version)"
innd --version || inn2 --version || true
nnptd --version || innd --version || inn2 --version || true
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: pre-commit/[email protected]
69 changes: 69 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Learn more about this config here: https://pre-commit.com/

# To enable these pre-commit hooks run:
# `pipx install pre-commit` or `brew install pre-commit`
# Then in the project root directory run `pre-commit install`

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-builtin-literals
- id: check-byte-order-marker
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-toml
- id: check-vcs-permalinks
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: destroyed-symlinks
- id: detect-private-key
- id: end-of-file-fixer
- id: file-contents-sorter
- id: fix-byte-order-marker
- id: forbid-new-submodules
- id: forbid-submodules
- id: mixed-line-ending
- id: name-tests-test
#- id: pretty-format-json
# exclude: fe/jsconfig.json,Pipfile.lock
- id: requirements-txt-fixer
- id: sort-simple-yaml
- id: trailing-whitespace

- repo: https://github.com/MarcoGorelli/auto-walrus
rev: 0.3.4
hooks:
- id: auto-walrus

- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell # See pyproject.toml for args
args: ["--ignore-words-list=teh"]
additional_dependencies:
- tomli

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.6.3
hooks: # Format before linting
- id: ruff-format
- id: ruff

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 2.2.1
hooks:
- id: pyproject-fmt

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.19
hooks:
- id: validate-pyproject

0 comments on commit bbbac2c

Please sign in to comment.