diff options
| author | 2026-01-16 10:19:21 +0800 | |
|---|---|---|
| committer | 2026-01-16 10:19:21 +0800 | |
| commit | f72ced61ae9230689431f378f7ea019919c510f5 (patch) | |
| tree | 7c290e5e53981db75cdcdc0be45648e5be0bc315 | |
| parent | f83ed85b510f3ab18c51e9c161a4afb23482b9de (diff) | |
| download | DropOut-f72ced61ae9230689431f378f7ea019919c510f5.tar.gz DropOut-f72ced61ae9230689431f378f7ea019919c510f5.zip | |
chore: add pre-commit configuration for linting and formatting
Introduced a new .pre-commit-config.yaml file to set up pre-commit hooks for code quality checks, including AST checks, JSON, TOML, and YAML validation, as well as Ruff for Python linting and formatting. Added custom hooks for linting and formatting Svelte/TypeScript/JavaScript files in the 'ui' directory.
| -rw-r--r-- | .pre-commit-config.yaml | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..12c05df --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,35 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 + hooks: + - id: check-ast + - id: check-case-conflict + - id: check-json + - id: check-toml + - id: check-yaml + - id: fix-byte-order-marker + + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.14.13 + hooks: + - id: ruff-check + types_or: [ python, pyi ] + args: [ --fix ] + - id: ruff-format + types_or: [ python, pyi ] + + - repo: local + hooks: + - id: oxlint + name: oxlint (svelte/ts/js) + entry: pnpm --dir ui run lint:fix + language: system + files: ^ui/ + pass_filenames: false + + - id: oxfmt + name: oxfmt (format) + entry: pnpm --dir ui run format + language: system + files: ^ui/ + pass_filenames: false
\ No newline at end of file |