mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-28 07:14:40 +08:00
95 lines
2.1 KiB
TOML
95 lines
2.1 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.format]
|
|
description = "Run code formatter"
|
|
command = "pnpm"
|
|
args = ["format"]
|
|
|
|
[tasks.format-check]
|
|
description = "Run format checks"
|
|
command = "pnpm"
|
|
args = ["format:check"]
|
|
[tasks.format-check.condition]
|
|
# TODO add more specific file patterns
|
|
files_modified = { input = [
|
|
"./src/**/*",
|
|
"./package.json",
|
|
"./pnpm-lock.yaml",
|
|
], output = [
|
|
"./node_modules/.last_format",
|
|
] }
|
|
[tasks.eslint]
|
|
description = "Run ESLint to lint the code"
|
|
command = "pnpm"
|
|
args = ["lint"]
|
|
|
|
[tasks.typecheck]
|
|
description = "Run type checks"
|
|
command = "pnpm"
|
|
args = ["typecheck"]
|
|
|
|
[tasks.lint-staged]
|
|
description = "Run lint-staged for staged files"
|
|
command = "pnpm"
|
|
args = ["exec", "lint-staged"]
|
|
|
|
[tasks.i18n-check]
|
|
description = "Check i18n consistency"
|
|
command = "pnpm"
|
|
args = ["i18n:types"]
|
|
[tasks.i18n-check.condition]
|
|
files_modified.input = ["./src/locales/**/*.ts", "./src/locales/**/*.json"]
|
|
files_modified.output = ["./src/types/generated/*.ts"]
|
|
|
|
# --- Jobs ---
|
|
[tasks.rust]
|
|
dependencies = ["rust-format", "rust-clippy"]
|
|
[tasks.rust.condition]
|
|
files_modified.input = [
|
|
"./src-tauri/**/*.rs",
|
|
"./crates/**/*.rs",
|
|
"**/Cargo.toml",
|
|
]
|
|
files_modified.output = ["./target/**/clash-verge"]
|
|
|
|
[tasks.typescript]
|
|
dependencies = ["format", "format-check", "eslint", "lint-staged", "typecheck"]
|
|
[tasks.typescript.condition]
|
|
files_modified.input = [
|
|
"**/*.ts",
|
|
"**/*.tsx",
|
|
"./package.json",
|
|
"./pnpm-lock.yaml",
|
|
"./tsconfig.json",
|
|
]
|
|
files_modified.output = [
|
|
"./node_modules/.last_format",
|
|
"./node_modules/.last_eslint",
|
|
"./node_modules/.last_typecheck",
|
|
]
|
|
|
|
[tasks.pre-push]
|
|
description = "Pre-push checks"
|
|
dependencies = ["rust", "format-check", "eslint", "typecheck"]
|
|
|
|
[tasks.pre-commit]
|
|
dependencies = ["rust", "typescript", "i18n-check"]
|