From f72ced61ae9230689431f378f7ea019919c510f5 Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Fri, 16 Jan 2026 10:19:21 +0800 Subject: 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. --- .pre-commit-config.yaml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .pre-commit-config.yaml (limited to '.pre-commit-config.yaml') 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 -- cgit v1.2.3-70-g09d2 From f1b297cca97b18e179e056233ffba146eab784cf Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Fri, 16 Jan 2026 10:22:58 +0800 Subject: chore: add cargo formatting and linting hooks to pre-commit configuration Enhanced the pre-commit configuration by adding hooks for Rust code formatting with `cargo fmt` and linting with `cargo clippy` for files in the `src-tauri` directory. This improves code quality checks for Rust components in the project. --- .pre-commit-config.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to '.pre-commit-config.yaml') diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 12c05df..0929a81 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,6 +20,20 @@ repos: - repo: local hooks: + - id: cargo-fmt + name: cargo fmt + entry: bash -c 'cd src-tauri && cargo fmt --all' + language: system + files: ^src-tauri/.*\.rs$ + pass_filenames: false + + - id: cargo-clippy + name: cargo clippy + entry: bash -c 'cd src-tauri && cargo clippy --all-targets --all-features -- -D warnings' + language: system + files: ^src-tauri/.*\.rs$ + pass_filenames: false + - id: oxlint name: oxlint (svelte/ts/js) entry: pnpm --dir ui run lint:fix -- cgit v1.2.3-70-g09d2 From 47ec90726e2402eba2cf4b50a2cc572f2cfbcbd5 Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Fri, 16 Jan 2026 13:52:26 +0800 Subject: chore: update pre-commit configuration for Rust and Python hooks Modified the .pre-commit-config.yaml to downgrade versions of pre-commit hooks for improved compatibility. Removed local Rust hooks and replaced them with hooks from the official Rust pre-commit repository, adding support for formatting and linting. Adjusted Python hooks to streamline the linting process. --- .pre-commit-config.yaml | 42 +++++++++--------------------------------- 1 file changed, 9 insertions(+), 33 deletions(-) (limited to '.pre-commit-config.yaml') diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0929a81..f8b6348 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,49 +1,25 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v6.0.0 + rev: v5.0.0 hooks: - id: check-ast - id: check-case-conflict - id: check-json + exclude: ^ui/tsconfig.*\.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 + rev: v0.1.6 hooks: - - id: ruff-check - types_or: [ python, pyi ] + - id: ruff args: [ --fix ] - id: ruff-format - types_or: [ python, pyi ] - - repo: local + - repo: https://github.com/doublify/pre-commit-rust + rev: v1.0 hooks: - - id: cargo-fmt - name: cargo fmt - entry: bash -c 'cd src-tauri && cargo fmt --all' - language: system - files: ^src-tauri/.*\.rs$ - pass_filenames: false - - - id: cargo-clippy - name: cargo clippy - entry: bash -c 'cd src-tauri && cargo clippy --all-targets --all-features -- -D warnings' - language: system - files: ^src-tauri/.*\.rs$ - pass_filenames: false - - - 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 + - id: fmt + - id: clippy + args: ["--", "-D", "warnings"] \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 1d1748edd845afe34d73dfecb59c10b14e204c50 Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Fri, 16 Jan 2026 13:55:57 +0800 Subject: chore: refine pre-commit configuration for Rust hooks Updated the .pre-commit-config.yaml to specify the manifest path for Rust hooks, ensuring proper integration with the Cargo.toml file in the src-tauri directory. This change enhances the functionality of the formatting and linting processes. --- .pre-commit-config.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to '.pre-commit-config.yaml') diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f8b6348..90070a5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,5 +21,6 @@ repos: rev: v1.0 hooks: - id: fmt + args: ["--manifest-path", "src-tauri/Cargo.toml"] - id: clippy - args: ["--", "-D", "warnings"] \ No newline at end of file + args: ["--manifest-path", "src-tauri/Cargo.toml", "--", "-D", "warnings"] \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 937df840425f669719247d2f8b7b455933a43118 Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Fri, 16 Jan 2026 13:56:33 +0800 Subject: chore: ensure newline at end of pre-commit configuration file Added a newline at the end of the .pre-commit-config.yaml file to adhere to best practices for file formatting, ensuring compatibility with various tools and editors. --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.pre-commit-config.yaml') diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 90070a5..d149a19 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,4 +23,4 @@ repos: - id: fmt args: ["--manifest-path", "src-tauri/Cargo.toml"] - id: clippy - args: ["--manifest-path", "src-tauri/Cargo.toml", "--", "-D", "warnings"] \ No newline at end of file + args: ["--manifest-path", "src-tauri/Cargo.toml", "--", "-D", "warnings"] -- cgit v1.2.3-70-g09d2 From 51929ac0808e7551ea4165dedad9687590de6028 Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Fri, 16 Jan 2026 13:58:24 +0800 Subject: chore: update clippy arguments in pre-commit configuration Modified the .pre-commit-config.yaml to change the arguments for the clippy hook, allowing it to automatically fix issues and permit changes in dirty working directories. This enhances the linting process for Rust code in the project. --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.pre-commit-config.yaml') diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d149a19..cf13202 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,4 +23,4 @@ repos: - id: fmt args: ["--manifest-path", "src-tauri/Cargo.toml"] - id: clippy - args: ["--manifest-path", "src-tauri/Cargo.toml", "--", "-D", "warnings"] + args: ["--manifest-path", "src-tauri/Cargo.toml", "--fix", "--allow-dirty"] -- cgit v1.2.3-70-g09d2 From e714e6f5739ba4e654a5572bdeaf8bf445aaecb7 Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Fri, 16 Jan 2026 13:59:39 +0800 Subject: chore: remove automatic fix option from clippy in pre-commit configuration Updated the .pre-commit-config.yaml to remove the automatic fix option for the clippy hook, streamlining the linting process for Rust code by requiring manual fixes. This change enhances control over code quality checks. --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.pre-commit-config.yaml') diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cf13202..f553eae 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,4 +23,4 @@ repos: - id: fmt args: ["--manifest-path", "src-tauri/Cargo.toml"] - id: clippy - args: ["--manifest-path", "src-tauri/Cargo.toml", "--fix", "--allow-dirty"] + args: ["--manifest-path", "src-tauri/Cargo.toml"] -- cgit v1.2.3-70-g09d2 From e76f9268537940aad526fd8795f2b23f13e39b12 Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Fri, 16 Jan 2026 14:00:34 +0800 Subject: chore: update pre-commit configuration to include additional argument for Rust hooks Modified the .pre-commit-config.yaml to add an extra argument to the formatting and clippy hooks, ensuring proper handling of additional parameters during execution. This change enhances the flexibility of the linting and formatting processes for Rust code. --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.pre-commit-config.yaml') diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f553eae..2862e75 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,6 +21,6 @@ repos: rev: v1.0 hooks: - id: fmt - args: ["--manifest-path", "src-tauri/Cargo.toml"] + args: ["--manifest-path", "src-tauri/Cargo.toml", "--"] - id: clippy - args: ["--manifest-path", "src-tauri/Cargo.toml"] + args: ["--manifest-path", "src-tauri/Cargo.toml", "--"] -- cgit v1.2.3-70-g09d2 From 3a64328733cf2f3153a7e6841217c4c239cd8b03 Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Fri, 16 Jan 2026 14:05:57 +0800 Subject: chore: update pre-commit configuration to change clippy and formatting arguments Modified the .pre-commit-config.yaml to adjust the arguments for the formatting and clippy hooks, switching to a check mode for formatting and enforcing warnings as errors for clippy. This change improves the linting and formatting processes for Rust code. --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.pre-commit-config.yaml') diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2862e75..a8ee70d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,6 +21,6 @@ repos: rev: v1.0 hooks: - id: fmt - args: ["--manifest-path", "src-tauri/Cargo.toml", "--"] + args: ["--check", "--manifest-path", "src-tauri/Cargo.toml", "--"] - id: clippy - args: ["--manifest-path", "src-tauri/Cargo.toml", "--"] + args: ["--manifest-path", "src-tauri/Cargo.toml", "-D", "warnings", "--"] -- cgit v1.2.3-70-g09d2 From 9948550785d6bf273cadd7dc132038277964e9eb Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Fri, 16 Jan 2026 14:09:04 +0800 Subject: chore: update clippy arguments in pre-commit configuration to remove warnings as errors Modified the .pre-commit-config.yaml to adjust the clippy hook arguments, removing the enforcement of warnings as errors. This change simplifies the linting process for Rust code, allowing for a more lenient approach to warnings. --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.pre-commit-config.yaml') diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a8ee70d..2524d4a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,4 +23,4 @@ repos: - id: fmt args: ["--check", "--manifest-path", "src-tauri/Cargo.toml", "--"] - id: clippy - args: ["--manifest-path", "src-tauri/Cargo.toml", "-D", "warnings", "--"] + args: ["--manifest-path", "src-tauri/Cargo.toml", "--"] -- cgit v1.2.3-70-g09d2 From 310aee29c1ea5149ef9d6cf663e4a07c3cb201ee Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Fri, 16 Jan 2026 14:09:41 +0800 Subject: chore: update clippy arguments in pre-commit configuration to treat warnings as errors Modified the .pre-commit-config.yaml to adjust the clippy hook arguments, enforcing warnings as errors. This change enhances the strictness of the linting process for Rust code, ensuring higher code quality standards. --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.pre-commit-config.yaml') diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2524d4a..a8ee70d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,4 +23,4 @@ repos: - id: fmt args: ["--check", "--manifest-path", "src-tauri/Cargo.toml", "--"] - id: clippy - args: ["--manifest-path", "src-tauri/Cargo.toml", "--"] + args: ["--manifest-path", "src-tauri/Cargo.toml", "-D", "warnings", "--"] -- cgit v1.2.3-70-g09d2 From f1eaa8fcc90c3fec0bcedc1ce060f1dcfea5bcd6 Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Fri, 16 Jan 2026 14:10:59 +0800 Subject: chore: adjust clippy arguments in pre-commit configuration for improved linting Modified the .pre-commit-config.yaml to reorder the arguments for the clippy hook, ensuring that the `-D warnings` flag is correctly positioned. This change enhances the clarity and effectiveness of the linting process for Rust code. --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.pre-commit-config.yaml') diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a8ee70d..01d4add 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,4 +23,4 @@ repos: - id: fmt args: ["--check", "--manifest-path", "src-tauri/Cargo.toml", "--"] - id: clippy - args: ["--manifest-path", "src-tauri/Cargo.toml", "-D", "warnings", "--"] + args: ["--manifest-path", "src-tauri/Cargo.toml", "--", "-D", "warnings"] -- cgit v1.2.3-70-g09d2 From 6beecb0dc8854ae2ed79da4a2be6e8bd895349e0 Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Fri, 16 Jan 2026 15:37:26 +0800 Subject: chore: update pre-commit configuration and remove unnecessary dependencies Modified the .pre-commit-config.yaml to include additional hooks and reorganized the repository structure. Updated pyproject.toml to remove the pre-commit dependency, streamlining the project configuration. --- .github/workflows/prek.yml | 22 ++++++++++++++++++++++ .pre-commit-config.yaml | 16 ++++++++++++---- pyproject.toml | 4 +--- 3 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/prek.yml (limited to '.pre-commit-config.yaml') diff --git a/.github/workflows/prek.yml b/.github/workflows/prek.yml new file mode 100644 index 0000000..094ebf9 --- /dev/null +++ b/.github/workflows/prek.yml @@ -0,0 +1,22 @@ +name: Prek Checks + +on: + push: + branches: ["main", "dev"] + pull_request: + branches: ["main", "dev"] + workflow_dispatch: + +permissions: + contents: read + +jobs: + prek: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Run prek + uses: j178/prek-action@v1 + with: + all_files: ${{ github.event_name == 'pull_request' }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 01d4add..0a9b345 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,14 +1,22 @@ +minimum_prek_version: '0.2.28' + repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + - repo: builtin hooks: - - id: check-ast - - id: check-case-conflict - id: check-json exclude: ^ui/tsconfig.*\.json$ - id: check-toml - id: check-yaml + - id: check-case-conflict - id: fix-byte-order-marker + - id: end-of-file-fixer + - id: check-merge-conflict + - id: detect-private-key + + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: check-ast - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.1.6 diff --git a/pyproject.toml b/pyproject.toml index 10e6bbf..d49374f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,9 +4,7 @@ dynamic = ["version"] description = "DropOut is a modern, minimalist, and efficient Minecraft launcher built with the latest web and system technologies. It leverages Tauri v2 to deliver a lightweight application with a robust Rust backend and a reactive Svelte 5 frontend." readme = "README.md" requires-python = ">=3.10" -dependencies = [ - "pre-commit>=4.5.1", -] +dependencies = [] [build-system] requires = ["hatchling"] -- cgit v1.2.3-70-g09d2 From cffc1cad8584c770de94dff87d519d1304f647d5 Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Fri, 16 Jan 2026 15:46:50 +0800 Subject: chore: update pre-commit configuration to enable autofix for PRs Added autofix settings to the pre-commit configuration, allowing automatic fixes for issues detected by hooks. Reorganized the repository structure for clarity and removed redundant entries. --- .pre-commit-config.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to '.pre-commit-config.yaml') diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0a9b345..b9d50cd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,12 @@ minimum_prek_version: '0.2.28' +ci: + autofix_prs: true + autofix_commit_msg: "[pre-commit.ci] auto fixes from pre-commit hooks [skip ci]" + repos: - - repo: builtin + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 hooks: - id: check-json exclude: ^ui/tsconfig.*\.json$ @@ -12,10 +17,6 @@ repos: - id: end-of-file-fixer - id: check-merge-conflict - id: detect-private-key - - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 - hooks: - id: check-ast - repo: https://github.com/astral-sh/ruff-pre-commit -- cgit v1.2.3-70-g09d2 From ab7bd0336a03fb1db4403472d85fe2a229b1b333 Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Fri, 16 Jan 2026 16:00:14 +0800 Subject: chore: update pre-commit configuration to skip formatting and clippy checks Modified the .pre-commit-config.yaml to skip the formatting and clippy checks during the CI process, optimizing the pre-commit workflow. Added Rust as the language for the pre-commit hook to ensure compatibility. --- .pre-commit-config.yaml | 3 +++ 1 file changed, 3 insertions(+) (limited to '.pre-commit-config.yaml') diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b9d50cd..75ea03b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,6 @@ minimum_prek_version: '0.2.28' + ci: autofix_prs: true autofix_commit_msg: "[pre-commit.ci] auto fixes from pre-commit hooks [skip ci]" @@ -21,6 +22,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.1.6 + language: python hooks: - id: ruff args: [ --fix ] @@ -28,6 +30,7 @@ repos: - repo: https://github.com/doublify/pre-commit-rust rev: v1.0 + language: rust hooks: - id: fmt args: ["--check", "--manifest-path", "src-tauri/Cargo.toml", "--"] -- cgit v1.2.3-70-g09d2 From 11757bd94dcb618f508f1439b846f586e7d6022a Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Fri, 16 Jan 2026 16:10:11 +0800 Subject: chore: update pre-commit configuration to specify language for hooks Removed the language specification for the ruff hook and added it for the fmt and clippy hooks, ensuring proper configuration for Rust in the pre-commit setup. --- .pre-commit-config.yaml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to '.pre-commit-config.yaml') diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 75ea03b..5a5ed67 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,3 @@ -minimum_prek_version: '0.2.28' - - ci: autofix_prs: true autofix_commit_msg: "[pre-commit.ci] auto fixes from pre-commit hooks [skip ci]" @@ -22,7 +19,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.1.6 - language: python hooks: - id: ruff args: [ --fix ] @@ -30,9 +26,12 @@ repos: - repo: https://github.com/doublify/pre-commit-rust rev: v1.0 - language: rust hooks: - id: fmt args: ["--check", "--manifest-path", "src-tauri/Cargo.toml", "--"] + files: ^src-tauri/.*\.rs$ + pass_filenames: false - id: clippy args: ["--manifest-path", "src-tauri/Cargo.toml", "--", "-D", "warnings"] + files: ^src-tauri/.*\.rs$ + pass_filenames: false -- cgit v1.2.3-70-g09d2 From 1ef7d139862de4ee93216fc617f9ee6c4002df5f Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Fri, 16 Jan 2026 20:43:21 +0800 Subject: chore: update pre-commit configuration to specify language for clippy checks Modified the .pre-commit-config.yaml file to explicitly set the language for clippy checks to 'system', ensuring consistent behavior across different environments. This change enhances the clarity of the configuration. --- .pre-commit-config.yaml | 2 ++ 1 file changed, 2 insertions(+) (limited to '.pre-commit-config.yaml') diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5a5ed67..1cfe197 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,7 +31,9 @@ repos: args: ["--check", "--manifest-path", "src-tauri/Cargo.toml", "--"] files: ^src-tauri/.*\.rs$ pass_filenames: false + language: system - id: clippy args: ["--manifest-path", "src-tauri/Cargo.toml", "--", "-D", "warnings"] files: ^src-tauri/.*\.rs$ pass_filenames: false + language: system -- cgit v1.2.3-70-g09d2 From bf934d63edda2129ffbe77a42486a9607b1c4eb0 Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Fri, 16 Jan 2026 20:44:37 +0800 Subject: chore: update pre-commit configuration to include Rust as system language Modified the .pre-commit-config.yaml file to add 'rust' to the system_language setting, ensuring that pre-commit hooks are properly configured for Rust projects. This change enhances the versatility of the pre-commit setup. --- .pre-commit-config.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to '.pre-commit-config.yaml') diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1cfe197..a9a0acb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,8 @@ ci: autofix_prs: true autofix_commit_msg: "[pre-commit.ci] auto fixes from pre-commit hooks [skip ci]" - + system_language: ["rust"] + repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 -- cgit v1.2.3-70-g09d2 From f6a88e61f789c58a9307dd7405faf00d92b5f84b Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Fri, 16 Jan 2026 20:51:36 +0800 Subject: chore: update pre-commit configuration for Rust hooks Modified the .pre-commit-config.yaml file to replace the Rust pre-commit repository and update the hooks for formatting and linting. This change enhances the configuration by using the latest version of the Rust pre-commit hooks and streamlining the setup for Rust projects. --- .pre-commit-config.yaml | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to '.pre-commit-config.yaml') diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a9a0acb..885534b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,11 +1,10 @@ ci: autofix_prs: true autofix_commit_msg: "[pre-commit.ci] auto fixes from pre-commit hooks [skip ci]" - system_language: ["rust"] - + repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: check-json exclude: ^ui/tsconfig.*\.json$ @@ -19,22 +18,15 @@ repos: - id: check-ast - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.6 + rev: v0.14.13 hooks: - id: ruff args: [ --fix ] - id: ruff-format - - repo: https://github.com/doublify/pre-commit-rust - rev: v1.0 + - repo: https://github.com/FeryET/pre-commit-rust + rev: v1.2.1 hooks: - id: fmt - args: ["--check", "--manifest-path", "src-tauri/Cargo.toml", "--"] - files: ^src-tauri/.*\.rs$ - pass_filenames: false - language: system + - id: cargo-check - id: clippy - args: ["--manifest-path", "src-tauri/Cargo.toml", "--", "-D", "warnings"] - files: ^src-tauri/.*\.rs$ - pass_filenames: false - language: system -- cgit v1.2.3-70-g09d2 From bb6cf77844343bbf55be3dad201340572564d132 Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Fri, 16 Jan 2026 20:53:01 +0800 Subject: chore: update pre-commit configuration to skip specific hooks Modified the .pre-commit-config.yaml file to add a skip option for formatting, cargo-check, and clippy hooks. This change optimizes the pre-commit setup by allowing selective execution of hooks, enhancing the efficiency of the development workflow. --- .pre-commit-config.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to '.pre-commit-config.yaml') diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 885534b..89bdd7e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,8 @@ ci: autofix_prs: true autofix_commit_msg: "[pre-commit.ci] auto fixes from pre-commit hooks [skip ci]" - + skip: [fmt,cargo-check,clippy] + repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v6.0.0 -- cgit v1.2.3-70-g09d2 From ba5235427efa74ae0eb4c167c5e75544b3a6c3ce Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Fri, 16 Jan 2026 21:03:30 +0800 Subject: chore: update pre-commit configuration for Rust hooks to specify manifest path Modified the .pre-commit-config.yaml file to include the `--manifest-path` argument for Rust hooks (fmt, cargo-check, clippy) and defined file patterns for Rust source files. This change enhances the configuration by ensuring that the hooks operate on the correct project files, improving the development workflow. --- .pre-commit-config.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to '.pre-commit-config.yaml') diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 89bdd7e..7e37cac 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ ci: autofix_prs: true autofix_commit_msg: "[pre-commit.ci] auto fixes from pre-commit hooks [skip ci]" skip: [fmt,cargo-check,clippy] - + repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v6.0.0 @@ -29,5 +29,11 @@ repos: rev: v1.2.1 hooks: - id: fmt + args: [ --manifest-path src-tauri/Cargo.toml ] + files: ^src-tauri/.*\.rs$ - id: cargo-check + args: [ --manifest-path src-tauri/Cargo.toml ] + files: ^src-tauri/.*\.rs$ - id: clippy + args: [ --manifest-path src-tauri/Cargo.toml ] + files: ^src-tauri/.*\.rs$ -- cgit v1.2.3-70-g09d2