Skip to content

Commit 1d91d56

Browse files
committed
chore: add pre-commit
1 parent b82e662 commit 1d91d56

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* text=auto eol=lf
2+
*.{cmd,[cC][mM][dD]} text eol=crlf
3+
*.{bat,[bB][aA][tT]} text eol=crlf

.pre-commit-config.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
default_language_version:
2+
python: python3.11
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v6.0.0
6+
hooks:
7+
- id: check-ast
8+
- id: check-merge-conflict
9+
- id: check-case-conflict
10+
- id: debug-statements
11+
- id: end-of-file-fixer
12+
exclude: (.*\.vscode\/.+json|.+code-workspace) # vscode </3 LF
13+
- id: mixed-line-ending
14+
- id: trailing-whitespace
15+
- repo: https://github.com/astral-sh/ruff-pre-commit
16+
rev: v0.12.10
17+
hooks:
18+
- id: ruff
19+
- id: ruff-format
20+
- repo: https://github.com/astral-sh/uv-pre-commit
21+
rev: 0.8.13
22+
hooks:
23+
- id: uv-lock

scripts/post-create.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,7 @@ echo 'eval "$(uv generate-shell-completion zsh)"' >> "/home/$USERNAME/.zshrc"
1717
echo 'eval "$(uvx --generate-shell-completion zsh)"' >> "/home/$USERNAME/.zshrc"
1818

1919
echo "uv sync ..."
20-
uv sync
20+
uv sync
21+
22+
echo "install pre-commit hooks ..."
23+
uv run pre-commit install

0 commit comments

Comments
 (0)