linthis 0.0.8__tar.gz → 0.0.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. {linthis-0.0.8 → linthis-0.0.9}/Cargo.lock +8 -1
  2. {linthis-0.0.8 → linthis-0.0.9}/Cargo.toml +4 -1
  3. {linthis-0.0.8 → linthis-0.0.9}/PKG-INFO +135 -96
  4. {linthis-0.0.8 → linthis-0.0.9}/README.md +134 -95
  5. linthis-0.0.9/docs/ROADMAP.md +192 -0
  6. {linthis-0.0.8 → linthis-0.0.9}/pyproject.toml +1 -1
  7. linthis-0.0.9/src/cache/hash.rs +125 -0
  8. linthis-0.0.9/src/cache/mod.rs +22 -0
  9. linthis-0.0.9/src/cache/storage.rs +365 -0
  10. linthis-0.0.9/src/cache/types.rs +195 -0
  11. {linthis-0.0.8 → linthis-0.0.9}/src/checkers/cpp.rs +6 -2
  12. linthis-0.0.9/src/checkers/dart.rs +156 -0
  13. {linthis-0.0.8 → linthis-0.0.9}/src/checkers/go.rs +8 -2
  14. {linthis-0.0.8 → linthis-0.0.9}/src/checkers/java.rs +3 -1
  15. linthis-0.0.9/src/checkers/kotlin.rs +150 -0
  16. linthis-0.0.9/src/checkers/lua.rs +144 -0
  17. {linthis-0.0.8 → linthis-0.0.9}/src/checkers/mod.rs +8 -0
  18. {linthis-0.0.8 → linthis-0.0.9}/src/checkers/python.rs +1 -1
  19. {linthis-0.0.8 → linthis-0.0.9}/src/checkers/rust.rs +1 -1
  20. linthis-0.0.9/src/checkers/swift.rs +152 -0
  21. {linthis-0.0.8 → linthis-0.0.9}/src/checkers/typescript.rs +3 -1
  22. linthis-0.0.9/src/cli/cache.rs +84 -0
  23. linthis-0.0.9/src/cli/commands.rs +478 -0
  24. linthis-0.0.9/src/cli/doctor.rs +557 -0
  25. linthis-0.0.9/src/cli/fix.rs +119 -0
  26. linthis-0.0.9/src/cli/helpers.rs +116 -0
  27. linthis-0.0.9/src/cli/hook.rs +931 -0
  28. linthis-0.0.9/src/cli/init.rs +330 -0
  29. linthis-0.0.9/src/cli/mod.rs +40 -0
  30. linthis-0.0.9/src/cli/paths.rs +250 -0
  31. linthis-0.0.9/src/cli/plugin.rs +868 -0
  32. linthis-0.0.9/src/cli/recheck.rs +181 -0
  33. linthis-0.0.9/src/cli/runner.rs +209 -0
  34. linthis-0.0.9/src/config/migrate/converters/eslint.rs +220 -0
  35. linthis-0.0.9/src/config/migrate/converters/mod.rs +15 -0
  36. linthis-0.0.9/src/config/migrate/converters/prettier.rs +91 -0
  37. linthis-0.0.9/src/config/migrate/converters/python.rs +261 -0
  38. linthis-0.0.9/src/config/migrate/detect.rs +231 -0
  39. linthis-0.0.9/src/config/migrate/mod.rs +201 -0
  40. linthis-0.0.9/src/config/migrate/parsers/eslint.rs +364 -0
  41. linthis-0.0.9/src/config/migrate/parsers/mod.rs +15 -0
  42. linthis-0.0.9/src/config/migrate/parsers/prettier.rs +248 -0
  43. linthis-0.0.9/src/config/migrate/parsers/python.rs +195 -0
  44. linthis-0.0.9/src/config/migrate/validate.rs +204 -0
  45. {linthis-0.0.8 → linthis-0.0.9}/src/config/mod.rs +305 -9
  46. {linthis-0.0.8 → linthis-0.0.9}/src/fixers/source.rs +10 -10
  47. {linthis-0.0.8 → linthis-0.0.9}/src/formatters/cpp.rs +14 -8
  48. linthis-0.0.9/src/formatters/dart.rs +104 -0
  49. {linthis-0.0.8 → linthis-0.0.9}/src/formatters/go.rs +14 -5
  50. {linthis-0.0.8 → linthis-0.0.9}/src/formatters/java.rs +17 -17
  51. linthis-0.0.9/src/formatters/kotlin.rs +108 -0
  52. linthis-0.0.9/src/formatters/lua.rs +103 -0
  53. {linthis-0.0.8 → linthis-0.0.9}/src/formatters/mod.rs +8 -0
  54. {linthis-0.0.8 → linthis-0.0.9}/src/formatters/python.rs +14 -5
  55. {linthis-0.0.8 → linthis-0.0.9}/src/formatters/rust.rs +14 -5
  56. linthis-0.0.9/src/formatters/swift.rs +121 -0
  57. {linthis-0.0.8 → linthis-0.0.9}/src/formatters/typescript.rs +14 -5
  58. {linthis-0.0.8 → linthis-0.0.9}/src/interactive/menu.rs +20 -9
  59. {linthis-0.0.8 → linthis-0.0.9}/src/interactive/mod.rs +27 -0
  60. {linthis-0.0.8 → linthis-0.0.9}/src/interactive/nolint.rs +164 -9
  61. {linthis-0.0.8 → linthis-0.0.9}/src/interactive/quickfix.rs +12 -7
  62. {linthis-0.0.8 → linthis-0.0.9}/src/lib.rs +335 -11
  63. linthis-0.0.9/src/main.rs +505 -0
  64. {linthis-0.0.8 → linthis-0.0.9}/src/plugin/auto_sync.rs +24 -15
  65. {linthis-0.0.8 → linthis-0.0.9}/src/plugin/config_manager.rs +28 -25
  66. {linthis-0.0.8 → linthis-0.0.9}/src/plugin/mod.rs +24 -0
  67. linthis-0.0.9/src/templates/linter_configs.rs +137 -0
  68. linthis-0.0.9/src/templates/mod.rs +22 -0
  69. linthis-0.0.9/src/templates/plugin_templates.rs +1861 -0
  70. linthis-0.0.9/src/templates/readme.rs +227 -0
  71. {linthis-0.0.8 → linthis-0.0.9}/src/utils/mod.rs +93 -0
  72. {linthis-0.0.8 → linthis-0.0.9}/src/utils/output.rs +153 -0
  73. {linthis-0.0.8 → linthis-0.0.9}/src/utils/types.rs +27 -0
  74. {linthis-0.0.8 → linthis-0.0.9}/src/utils/walker.rs +42 -1
  75. linthis-0.0.9/tests/cli_tests.rs +3 -0
  76. linthis-0.0.9/tests/fixtures/python/bad.py +7 -0
  77. linthis-0.0.9/tests/fixtures/python/good.py +10 -0
  78. linthis-0.0.9/tests/fixtures/python/unformatted.py +3 -0
  79. linthis-0.0.9/tests/fixtures/rust/bad.rs +4 -0
  80. linthis-0.0.9/tests/integration/cache_tests.rs +221 -0
  81. linthis-0.0.9/tests/integration/check_tests.rs +243 -0
  82. linthis-0.0.9/tests/integration/common.rs +345 -0
  83. linthis-0.0.9/tests/integration/config_tests.rs +254 -0
  84. linthis-0.0.9/tests/integration/error_tests.rs +243 -0
  85. linthis-0.0.9/tests/integration/format_tests.rs +158 -0
  86. linthis-0.0.9/tests/integration/language_tests.rs +376 -0
  87. linthis-0.0.9/tests/integration/mod.rs +137 -0
  88. linthis-0.0.9/tests/integration/plugin_tests.rs +238 -0
  89. linthis-0.0.8/src/main.rs +0 -5373
  90. linthis-0.0.8/tests/integration/mod.rs +0 -3
  91. {linthis-0.0.8 → linthis-0.0.9}/.github/workflows/release.yml +0 -0
  92. {linthis-0.0.8 → linthis-0.0.9}/.gitignore +0 -0
  93. {linthis-0.0.8 → linthis-0.0.9}/CHANGELOG.md +0 -0
  94. {linthis-0.0.8 → linthis-0.0.9}/defaults/.clang-tidy +0 -0
  95. {linthis-0.0.8 → linthis-0.0.9}/defaults/config.toml +0 -0
  96. {linthis-0.0.8 → linthis-0.0.9}/dev.sh +0 -0
  97. {linthis-0.0.8 → linthis-0.0.9}/docs/AUTO_SYNC.md +0 -0
  98. {linthis-0.0.8 → linthis-0.0.9}/docs/GLOBAL_HOOKS.md +0 -0
  99. {linthis-0.0.8 → linthis-0.0.9}/docs/SELF_UPDATE.md +0 -0
  100. {linthis-0.0.8 → linthis-0.0.9}/docs/config-cli-design.md +0 -0
  101. {linthis-0.0.8 → linthis-0.0.9}/docs/init-hooks-design.md +0 -0
  102. {linthis-0.0.8 → linthis-0.0.9}/docs/plan-ruff-integration.md +0 -0
  103. {linthis-0.0.8 → linthis-0.0.9}/docs/tasks.md +0 -0
  104. {linthis-0.0.8 → linthis-0.0.9}/scripts/release.sh +0 -0
  105. {linthis-0.0.8 → linthis-0.0.9}/src/benchmark.rs +0 -0
  106. {linthis-0.0.8 → linthis-0.0.9}/src/checkers/traits.rs +0 -0
  107. {linthis-0.0.8 → linthis-0.0.9}/src/config/cli.rs +0 -0
  108. {linthis-0.0.8 → linthis-0.0.9}/src/fixers/cpplint.rs +0 -0
  109. {linthis-0.0.8 → linthis-0.0.9}/src/fixers/mod.rs +0 -0
  110. {linthis-0.0.8 → linthis-0.0.9}/src/formatters/traits.rs +0 -0
  111. {linthis-0.0.8 → linthis-0.0.9}/src/interactive/editor.rs +0 -0
  112. {linthis-0.0.8 → linthis-0.0.9}/src/plugin/cache.rs +0 -0
  113. {linthis-0.0.8 → linthis-0.0.9}/src/plugin/fetcher.rs +0 -0
  114. {linthis-0.0.8 → linthis-0.0.9}/src/plugin/loader.rs +0 -0
  115. {linthis-0.0.8 → linthis-0.0.9}/src/plugin/manifest.rs +0 -0
  116. {linthis-0.0.8 → linthis-0.0.9}/src/plugin/registry.rs +0 -0
  117. {linthis-0.0.8 → linthis-0.0.9}/src/presets/mod.rs +0 -0
  118. {linthis-0.0.8 → linthis-0.0.9}/src/self_update.rs +0 -0
  119. {linthis-0.0.8 → linthis-0.0.9}/src/utils/language.rs +0 -0
  120. {linthis-0.0.8 → linthis-0.0.9}/src/utils/unicode.rs +0 -0
  121. {linthis-0.0.8 → linthis-0.0.9}/test-plugin-check/README.md +0 -0
  122. {linthis-0.0.8 → linthis-0.0.9}/test-plugin-check/linthis-plugin.toml +0 -0
  123. {linthis-0.0.8 → linthis-0.0.9}/tests/fixtures/test-plugin/linthis-plugin.toml +0 -0
  124. {linthis-0.0.8 → linthis-0.0.9}/tests/fixtures/test-plugin/python/ruff.toml +0 -0
  125. {linthis-0.0.8 → linthis-0.0.9}/tests/fixtures/test-plugin/rust/clippy.toml +0 -0
  126. {linthis-0.0.8 → linthis-0.0.9}/tests/fixtures/test-plugin/rust/rustfmt.toml +0 -0
  127. {linthis-0.0.8 → linthis-0.0.9}/tests/fixtures/us1/good.rs +0 -0
  128. {linthis-0.0.8 → linthis-0.0.9}/tests/fixtures/us1/unformatted.rs +0 -0
@@ -497,7 +497,7 @@ dependencies = [
497
497
 
498
498
  [[package]]
499
499
  name = "linthis"
500
- version = "0.0.8"
500
+ version = "0.0.9"
501
501
  dependencies = [
502
502
  "anyhow",
503
503
  "chrono",
@@ -520,6 +520,7 @@ dependencies = [
520
520
  "toml",
521
521
  "toml_edit",
522
522
  "walkdir",
523
+ "xxhash-rust",
523
524
  ]
524
525
 
525
526
  [[package]]
@@ -1111,3 +1112,9 @@ name = "wit-bindgen"
1111
1112
  version = "0.46.0"
1112
1113
  source = "registry+https://github.com/rust-lang/crates.io-index"
1113
1114
  checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59"
1115
+
1116
+ [[package]]
1117
+ name = "xxhash-rust"
1118
+ version = "0.8.15"
1119
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1120
+ checksum = "fdd20c5420375476fbd4394763288da7eb0cc0b8c11deed431a91562af7335d3"
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "linthis"
3
- version = "0.0.8"
3
+ version = "0.0.9"
4
4
  edition = "2021"
5
5
  authors = ["zhlinh"]
6
6
  description = "A fast, cross-platform multi-language linter and formatter"
@@ -48,6 +48,9 @@ similar = "2.4"
48
48
  # Lazy initialization
49
49
  lazy_static = "1.4"
50
50
 
51
+ # Fast hashing (for file cache)
52
+ xxhash-rust = { version = "0.8", features = ["xxh64"] }
53
+
51
54
  # Logging
52
55
  log = "0.4"
53
56
  env_logger = "0.10"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: linthis
3
- Version: 0.0.8
3
+ Version: 0.0.9
4
4
  Classifier: Development Status :: 3 - Alpha
5
5
  Classifier: Environment :: Console
6
6
  Classifier: Intended Audience :: Developers
@@ -76,17 +76,20 @@ linthis init
76
76
  # Create global configuration file
77
77
  linthis init -g
78
78
 
79
- # Create global git hook template (for all new repos)
80
- linthis init -g --hook-type git
79
+ # Install pre-commit hooks (project-level)
80
+ linthis hook install --type prek
81
+ linthis hook install --type pre-commit
82
+ linthis hook install --type git
81
83
 
82
- # Initialize with pre-commit hooks (project-level)
83
- linthis init --hook-type prek
84
- linthis init --hook-type pre-commit
85
- linthis init --hook-type git
84
+ # Install pre-push hook
85
+ linthis hook install --type git --event pre-push
86
+
87
+ # Install commit-msg hook
88
+ linthis hook install --type git --event commit-msg
86
89
 
87
90
  # Force overwrite existing files
88
91
  linthis init --force
89
- linthis init --hook-type prek -f
92
+ linthis hook install --type prek --force
90
93
  ```
91
94
 
92
95
  ### Basic Usage
@@ -159,9 +162,13 @@ Plugins are automatically loaded when running linthis. After adding a plugin:
159
162
  linthis
160
163
 
161
164
  # Combine with other options
162
- linthis -l python -i src/
163
- linthis --check-only
164
- linthis --staged
165
+ linthis -i src/
166
+ # Check only
167
+ linthis -c
168
+ # Format only
169
+ linthis -f
170
+ # Check and format files staged
171
+ linthis -s
165
172
  ```
166
173
 
167
174
  ### Remove Plugin
@@ -396,6 +403,49 @@ linthis config add -g excludes "node_modules/**"
396
403
  linthis config add -g excludes ".git/**"
397
404
  ```
398
405
 
406
+ ### Configuration Migration
407
+
408
+ linthis can automatically detect and migrate existing linter/formatter configurations to linthis format.
409
+
410
+ #### Supported Tools
411
+
412
+ | Tool | Detected Files |
413
+ | -------- | --------------------------------------------------------------------------------------------- |
414
+ | ESLint | `.eslintrc.js`, `.eslintrc.json`, `.eslintrc.yml`, `.eslintrc`, `eslint.config.js`, `package.json[eslintConfig]` |
415
+ | Prettier | `.prettierrc`, `.prettierrc.json`, `.prettierrc.yml`, `.prettierrc.js`, `prettier.config.js`, `package.json[prettier]` |
416
+ | Black | `pyproject.toml[tool.black]` |
417
+ | isort | `pyproject.toml[tool.isort]` |
418
+
419
+ #### Migration Commands
420
+
421
+ ```bash
422
+ # Auto-detect and migrate all configs
423
+ linthis config migrate
424
+
425
+ # Migrate specific tool only
426
+ linthis config migrate --from eslint
427
+ linthis config migrate --from prettier
428
+ linthis config migrate --from black
429
+ linthis config migrate --from isort
430
+
431
+ # Preview changes without applying
432
+ linthis config migrate --dry-run
433
+
434
+ # Create backup of original files
435
+ linthis config migrate --backup
436
+
437
+ # Verbose output
438
+ linthis config migrate --verbose
439
+ ```
440
+
441
+ #### Migration Output
442
+
443
+ Migrated configurations are placed in `.linthis/configs/{language}/`:
444
+
445
+ - ESLint → `.linthis/configs/javascript/.eslintrc.js`
446
+ - Prettier → `.linthis/configs/javascript/prettierrc.js`
447
+ - Black/isort → `.linthis/configs/python/ruff.toml`
448
+
399
449
  ### Initialize Configuration File
400
450
 
401
451
  Use the `init` subcommand to explicitly create configuration files:
@@ -425,71 +475,97 @@ All modifications preserve TOML file format and comments.
425
475
 
426
476
  ### Main Command Options
427
477
 
428
- | Short | Long | Description | Example |
429
- | ----- | ----------------------- | ---------------------------------------- | ----------------------- |
430
- | `-i` | `--include` | Specify files or directories to check | `-i src -i lib` |
478
+ | Short | Long | Description | Example |
479
+ | ----- | ----------------------- | --------------------------------------------- | ----------------------- |
480
+ | `-i` | `--include` | Specify files or directories to check | `-i src -i lib` |
431
481
  | `-e` | `--exclude` | Exclude patterns (can be used multiple times) | `-e "*.test.js"` |
432
- | `-c` | `--check-only` | Check only, no formatting | `-c` |
433
- | `-f` | `--format-only` | Format only, no checking | `-f` |
434
- | `-s` | `--staged` | Check only Git staged files | `-s` |
435
- | `-l` | `--lang` | Specify languages (comma-separated) | `-l python,rust` |
436
- | `-o` | `--output` | Output format: human, json, github-actions | `-o json` |
437
- | `-v` | `--verbose` | Verbose output | `-v` |
438
- | `-q` | `--quiet` | Quiet mode (errors only) | `-q` |
439
- | | `--config` | Specify config file path | `--config custom.toml` |
440
- | | `--init` | Initialize .linthis.toml config file | `--init` |
441
- | | `--preset` | Format preset | `--preset google` |
442
- | | `--no-default-excludes` | Disable default exclude rules | `--no-default-excludes` |
443
- | | `--no-gitignore` | Disable .gitignore rules | `--no-gitignore` |
444
- | | `--no-plugin` | Skip loading plugins, use default config | `--no-plugin` |
482
+ | `-c` | `--check-only` | Check only, no formatting | `-c` |
483
+ | `-f` | `--format-only` | Format only, no checking | `-f` |
484
+ | `-s` | `--staged` | Check only Git staged files | `-s` |
485
+ | `-l` | `--lang` | Specify languages (comma-separated) | `-l python,rust` |
486
+ | `-o` | `--output` | Output format: human, json, github-actions | `-o json` |
487
+ | `-v` | `--verbose` | Verbose output | `-v` |
488
+ | `-q` | `--quiet` | Quiet mode (errors only) | `-q` |
489
+ | | `--config` | Specify config file path | `--config custom.toml` |
490
+ | | `--init` | Initialize .linthis.toml config file | `--init` |
491
+ | | `--preset` | Format preset | `--preset google` |
492
+ | | `--no-default-excludes` | Disable default exclude rules | `--no-default-excludes` |
493
+ | | `--no-gitignore` | Disable .gitignore rules | `--no-gitignore` |
494
+ | | `--no-plugin` | Skip loading plugins, use default config | `--no-plugin` |
445
495
 
446
496
  ### Plugin Management Subcommands
447
497
 
448
- | Command | Short | Long | Description |
449
- | -------------------------- | ----- | ----------- | ------------------------- |
450
- | `plugin add <alias> <url>` | `-g` | `--global` | Add to global config |
451
- | | | `--ref` | Specify Git reference |
452
- | `plugin remove <alias>` | `-g` | `--global` | Remove from global config |
453
- | `plugin list` | `-g` | `--global` | Show global config plugins|
454
- | | `-v` | `--verbose` | Show detailed info |
455
- | `plugin clean` | | `--all` | Clean all caches |
456
- | `plugin init <name>` | | | Initialize new plugin |
457
- | `plugin validate <path>` | | | Validate plugin structure |
498
+ | Command | Short | Long | Description |
499
+ | -------------------------- | ----- | ----------- | -------------------------- |
500
+ | `plugin add <alias> <url>` | `-g` | `--global` | Add to global config |
501
+ | | | `--ref` | Specify Git reference |
502
+ | `plugin remove <alias>` | `-g` | `--global` | Remove from global config |
503
+ | `plugin list` | `-g` | `--global` | Show global config plugins |
504
+ | | `-v` | `--verbose` | Show detailed info |
505
+ | `plugin clean` | | `--all` | Clean all caches |
506
+ | `plugin init <name>` | | | Initialize new plugin |
507
+ | `plugin validate <path>` | | | Validate plugin structure |
458
508
 
459
509
  ### Configuration Management Subcommands
460
510
 
461
- | Command | Short | Long | Description |
462
- | ------------------------------- | ----- | ----------- | ------------------------------- |
463
- | `config add <field> <value>` | `-g` | `--global` | Add value to array field |
464
- | `config remove <field> <value>` | `-g` | `--global` | Remove value from array field |
465
- | `config clear <field>` | `-g` | `--global` | Clear array field |
466
- | `config set <field> <value>` | `-g` | `--global` | Set scalar field value |
467
- | `config unset <field>` | `-g` | `--global` | Remove scalar field |
468
- | `config get <field>` | `-g` | `--global` | Get field value |
469
- | `config list` | `-g` | `--global` | List all configuration |
511
+ | Command | Short | Long | Description |
512
+ | ------------------------------- | ----- | ----------- | ------------------------------------------- |
513
+ | `config add <field> <value>` | `-g` | `--global` | Add value to array field |
514
+ | `config remove <field> <value>` | `-g` | `--global` | Remove value from array field |
515
+ | `config clear <field>` | `-g` | `--global` | Clear array field |
516
+ | `config set <field> <value>` | `-g` | `--global` | Set scalar field value |
517
+ | `config unset <field>` | `-g` | `--global` | Remove scalar field |
518
+ | `config get <field>` | `-g` | `--global` | Get field value |
519
+ | `config list` | `-g` | `--global` | List all configuration |
470
520
  | | `-v` | `--verbose` | Show detailed info (including empty values) |
521
+ | `config migrate` | | `--from` | Migrate from specific tool |
522
+ | | | `--dry-run` | Preview changes without applying |
523
+ | | | `--backup` | Create backup of original files |
524
+ | | `-v` | `--verbose` | Show detailed output |
471
525
 
472
526
  **Supported array fields**: `includes`, `excludes`, `languages`
473
527
  **Supported scalar fields**: `max_complexity`, `preset`, `verbose`
474
528
 
475
529
  ### Init Subcommand
476
530
 
477
- | Command | Short | Long | Description |
478
- | ------- | ----- | ---------- | ---------------------------------- |
479
- | `init` | `-g` | `--global` | Create global config file |
480
- | | | `--hook` | Initialize pre-commit hooks |
481
- | | `-i` | `--interactive` | Interactive mode for hooks setup |
482
- | | `-f` | `--force` | Force overwrite existing files |
531
+ | Command | Short | Long | Description |
532
+ | ------- | ----- | ------------- | -------------------------------- |
533
+ | `init` | `-g` | `--global` | Create global config file |
534
+ | | | `--with-hook` | Also install git hook after init |
535
+ | | | `--force` | Force overwrite existing files |
483
536
 
484
537
  **Created configuration files**:
538
+
485
539
  - Without `-g`: Creates `.linthis.toml` (current directory)
486
540
  - With `-g`: Creates `~/.linthis/config.toml` (global config)
487
541
 
488
- **Hook options**:
542
+ ### Hook Subcommand
543
+
544
+ | Command | Short | Long | Description |
545
+ | ---------------- | ----- | --------------- | -------------------------------------- |
546
+ | `hook install` | | `--type` | Hook type (prek/pre-commit/git) |
547
+ | | | `--event` | Hook event (pre-commit/pre-push/commit-msg) |
548
+ | | `-c` | `--check-only` | Hook only runs check |
549
+ | | `-f` | `--format-only` | Hook only runs format |
550
+ | | | `--force` | Force overwrite existing hook |
551
+ | | `-y` | `--yes` | Non-interactive mode |
552
+ | `hook uninstall` | | `--event` | Hook event to uninstall |
553
+ | | `-y` | `--yes` | Non-interactive mode |
554
+ | `hook status` | | | Show git hook status |
555
+ | `hook check` | | | Check for hook conflicts |
556
+
557
+ **Hook types**:
558
+
489
559
  - `prek`: Rust-based pre-commit tool (faster)
490
560
  - `pre-commit`: Python-based standard tool
491
561
  - `git`: Traditional git hook
492
562
 
563
+ **Hook events**:
564
+
565
+ - `pre-commit`: Run before commit (default, checks staged files)
566
+ - `pre-push`: Run before push (checks all files)
567
+ - `commit-msg`: Validate commit message format
568
+
493
569
  ## Supported Languages
494
570
 
495
571
  | Language | Linter | Formatter |
@@ -510,45 +586,7 @@ All modifications preserve TOML file format and comments.
510
586
 
511
587
  ### Pre-commit Hook
512
588
 
513
- #### Method 1: Global Hook Template (One-time Setup)
514
-
515
- Set up a global Git hook template that applies to all new repositories:
516
-
517
- ```bash
518
- # Create global hook template
519
- linthis init -g --hook-type git
520
-
521
- # All new repos will automatically include the hook
522
- git init new-project
523
- cd new-project
524
- # .git/hooks/pre-commit is already set up!
525
- ```
526
-
527
- For existing repositories:
528
- ```bash
529
- cd existing-project
530
- git init # Re-apply template
531
- ```
532
-
533
- **Features:**
534
- - 🎯 **Smart Detection**: Only runs if project has linthis config
535
- - 🔗 **Hook Chaining**: Supports `.git/hooks/pre-commit.local` for project-specific hooks
536
- - 🚫 **Zero Interference**: Projects without linthis config are not affected
537
- - ⚡ **One-time Setup**: Works for all your new repositories
538
-
539
- **Pros:**
540
- - One-time setup for all your projects
541
- - No need to configure hooks per project
542
- - Perfect for personal development
543
- - Won't interfere with other projects or hook tools
544
-
545
- **Cons:**
546
- - Not shared with team members
547
- - Requires manual setup on each machine
548
-
549
- See [Global Hooks Guide](docs/GLOBAL_HOOKS.md) for details.
550
-
551
- #### Method 2: Using prek (Recommended for Teams)
589
+ #### Method 1: Using prek (Recommended for Teams)
552
590
 
553
591
  [prek](https://prek.j178.dev) is a high-performance Git hooks manager written in Rust, fully compatible with pre-commit config format but much faster.
554
592
 
@@ -582,7 +620,7 @@ Install hook:
582
620
  prek install
583
621
  ```
584
622
 
585
- #### Method 3: Traditional Git Hook (Project-level)
623
+ #### Method 2: Traditional Git Hook (Project-level)
586
624
 
587
625
  Add to `.git/hooks/pre-commit`:
588
626
 
@@ -592,11 +630,12 @@ linthis --staged --check-only
592
630
  ```
593
631
 
594
632
  Or use linthis to create it automatically:
633
+
595
634
  ```bash
596
- linthis init --hook-type git
635
+ linthis hook install --type git
597
636
  ```
598
637
 
599
- #### Method 4: Using pre-commit Framework
638
+ #### Method 3: Using pre-commit Framework
600
639
 
601
640
  Using the [pre-commit](https://pre-commit.com/) framework:
602
641
 
@@ -717,7 +756,7 @@ linthis -l python # Only check Python files
717
756
 
718
757
  - macOS: `~/Library/Caches/linthis/plugins`
719
758
  - Linux: `~/.cache/linthis/plugins`
720
- - Windows: `%LOCALAPPDATA%\linthis\plugins`
759
+ - Windows: `%LOCALAPPDATA%\linthis\cache\plugins`
721
760
 
722
761
  ### Q: How to update plugins?
723
762