Skip to content

Commit

Permalink
Add pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
pythoninthegrass committed Aug 18, 2023
1 parent 77b13f9 commit 09414b0
Show file tree
Hide file tree
Showing 4 changed files with 194 additions and 3 deletions.
42 changes: 42 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
fail_fast: true

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.285
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: check-added-large-files
args: ['--maxkb=1024']
- id: check-docstring-first
exclude: |
(?x)^(
scratch.py
)$
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-toml
- id: check-yaml
args: [--unsafe]
- id: debug-statements
- id: destroyed-symlinks
- id: detect-private-key
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: pretty-format-json
# https://pre-commit.com/#regular-expressions
exclude: |
(?x)^(
.devcontainer/devcontainer.json|
.vscode/launch.json|
.vscode/settings.json
)$
args: ['--autofix', '--indent=2', '--no-sort-keys']
- id: requirements-txt-fixer
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,28 @@ Additional tooling includes but is not limited to:
ruff --coverage --open
```

#### dependabot
#### pre-commit

* [Dependabot](https://dependabot.com/) is a GitHub tool that automatically creates pull requests to keep dependencies up to date.
```bash
# install pre-commit dev dependency
poetry install
# install pre-commit hooks
pre-commit install
# update
pre-commit autoupdate
```

#### editorconfig

Handles formatting of files. [Install the editorconfig plugin](https://editorconfig.org/#download) for your editor of choice.

#### dependabot

* [Dependabot](https://dependabot.com/) is a GitHub tool that automatically creates pull requests to keep dependencies up to date.


## TODO

* QA
Expand Down
136 changes: 135 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pywebview = "^4.2.2"
[tool.poetry.group.dev.dependencies]
icecream = "^2.1.1"
ipython = "^8.14.0"
pre-commit = "^3.3.3"
rich = "^13.5.2"
ruff = "^0.0.285"
tk = "^0.1.0"
Expand Down

0 comments on commit 09414b0

Please sign in to comment.