mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-28 07:14:40 +08:00
* feat: implement pre-push checks using cargo make and add Makefile.toml for task management * feat: enhance Makefile.toml with condition checks for tasks and improve clippy args * fix: update file patterns for format-check task in Makefile.toml * feat: update file patterns for eslint and typecheck tasks in Makefile.toml * feat: refactor Makefile.toml to consolidate Rust tasks and update pre-commit checks * feat: update Makefile.toml to add i18n-check and lint-staged tasks; modify pre-commit script * feat: update Makefile.toml to add i18n-check and lint-staged tasks; modify pre-commit script * refactor: simplify Makefile.toml by removing unused conditions and consolidating dependencies * feat: update Makefile.toml to define Rust and frontend tasks for pre-commit and pre-push checks * chore: remove unnecessary tasks * chore: add windows override * chore: remove format and format-check --------- Co-authored-by: Slinetrac <realakayuki@gmail.com>
87 lines
2.0 KiB
TOML
87 lines
2.0 KiB
TOML
[config]
|
|
skip_core_tasks = true
|
|
skip_git_env_info = true
|
|
skip_rust_env_info = true
|
|
skip_crate_env_info = true
|
|
|
|
# --- Backend ---
|
|
|
|
[tasks.rust-format]
|
|
install_crate = "rustfmt"
|
|
command = "cargo"
|
|
args = ["fmt", "--", "--emit=files"]
|
|
|
|
[tasks.rust-clippy]
|
|
description = "Run cargo clippy to lint the code"
|
|
command = "cargo"
|
|
args = ["clippy", "--all-targets", "--all-features", "--", "-D", "warnings"]
|
|
|
|
# --- Frontend ---
|
|
|
|
[tasks.eslint]
|
|
description = "Run ESLint to lint the code"
|
|
command = "pnpm"
|
|
args = ["lint"]
|
|
[tasks.eslint.windows]
|
|
command = "pnpm.cmd"
|
|
|
|
[tasks.typecheck]
|
|
description = "Run type checks"
|
|
command = "pnpm"
|
|
args = ["typecheck"]
|
|
[tasks.typecheck.windows]
|
|
command = "pnpm.cmd"
|
|
|
|
[tasks.lint-staged]
|
|
description = "Run lint-staged for staged files"
|
|
command = "pnpm"
|
|
args = ["exec", "lint-staged"]
|
|
[tasks.lint-staged.windows]
|
|
command = "pnpm.cmd"
|
|
|
|
# --- Jobs ---
|
|
|
|
# Rust format (for pre-commit)
|
|
[tasks.rust-format-check]
|
|
description = "Check Rust code formatting"
|
|
dependencies = ["rust-format"]
|
|
[tasks.rust-format-check.condition]
|
|
files_modified.input = [
|
|
"./src-tauri/**/*.rs",
|
|
"./crates/**/*.rs",
|
|
"**/Cargo.toml",
|
|
]
|
|
files_modified.output = ["./target/debug/*", "./target/release/*"]
|
|
|
|
# Rust lint (for pre-push)
|
|
[tasks.rust-lint]
|
|
description = "Run Rust linting"
|
|
dependencies = ["rust-clippy"]
|
|
[tasks.rust-lint.condition]
|
|
files_modified.input = [
|
|
"./src-tauri/**/*.rs",
|
|
"./crates/**/*.rs",
|
|
"**/Cargo.toml",
|
|
]
|
|
files_modified.output = ["./target/debug/*", "./target/release/*"]
|
|
|
|
# Frontend format (for pre-commit)
|
|
[tasks.frontend-format]
|
|
description = "Frontend format checks"
|
|
dependencies = ["lint-staged"]
|
|
|
|
# Frontend lint (for pre-push)
|
|
[tasks.frontend-lint]
|
|
description = "Frontend linting and type checking"
|
|
dependencies = ["eslint", "typecheck"]
|
|
|
|
# --- Git Hooks ---
|
|
|
|
[tasks.pre-commit]
|
|
description = "Pre-commit checks: format only"
|
|
dependencies = ["rust-format-check", "frontend-format"]
|
|
|
|
[tasks.pre-push]
|
|
description = "Pre-push checks: lint and typecheck"
|
|
dependencies = ["rust-lint", "frontend-lint"]
|