linthis 0.0.7__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.7 → linthis-0.0.9}/Cargo.lock +15 -1
  2. {linthis-0.0.7 → linthis-0.0.9}/Cargo.toml +7 -1
  3. {linthis-0.0.7 → linthis-0.0.9}/PKG-INFO +145 -104
  4. {linthis-0.0.7 → linthis-0.0.9}/README.md +144 -103
  5. linthis-0.0.9/docs/ROADMAP.md +192 -0
  6. {linthis-0.0.7 → 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.7 → linthis-0.0.9}/src/checkers/cpp.rs +76 -10
  12. linthis-0.0.9/src/checkers/dart.rs +156 -0
  13. {linthis-0.0.7 → linthis-0.0.9}/src/checkers/go.rs +8 -2
  14. {linthis-0.0.7 → 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.7 → linthis-0.0.9}/src/checkers/mod.rs +8 -0
  18. {linthis-0.0.7 → linthis-0.0.9}/src/checkers/python.rs +1 -1
  19. {linthis-0.0.7 → 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.7 → 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.7 → linthis-0.0.9}/src/config/mod.rs +308 -9
  46. {linthis-0.0.7 → linthis-0.0.9}/src/fixers/source.rs +10 -10
  47. {linthis-0.0.7 → 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.7 → linthis-0.0.9}/src/formatters/go.rs +14 -5
  50. {linthis-0.0.7 → 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.7 → linthis-0.0.9}/src/formatters/mod.rs +8 -0
  54. {linthis-0.0.7 → linthis-0.0.9}/src/formatters/python.rs +14 -5
  55. {linthis-0.0.7 → 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.7 → linthis-0.0.9}/src/formatters/typescript.rs +14 -5
  58. linthis-0.0.9/src/interactive/editor.rs +300 -0
  59. linthis-0.0.9/src/interactive/menu.rs +745 -0
  60. linthis-0.0.9/src/interactive/mod.rs +54 -0
  61. linthis-0.0.9/src/interactive/nolint.rs +883 -0
  62. linthis-0.0.9/src/interactive/quickfix.rs +176 -0
  63. {linthis-0.0.7 → linthis-0.0.9}/src/lib.rs +509 -87
  64. linthis-0.0.9/src/main.rs +505 -0
  65. {linthis-0.0.7 → linthis-0.0.9}/src/plugin/auto_sync.rs +24 -15
  66. {linthis-0.0.7 → linthis-0.0.9}/src/plugin/config_manager.rs +28 -25
  67. {linthis-0.0.7 → linthis-0.0.9}/src/plugin/mod.rs +24 -0
  68. linthis-0.0.9/src/templates/linter_configs.rs +137 -0
  69. linthis-0.0.9/src/templates/mod.rs +22 -0
  70. linthis-0.0.9/src/templates/plugin_templates.rs +1861 -0
  71. linthis-0.0.9/src/templates/readme.rs +227 -0
  72. {linthis-0.0.7 → linthis-0.0.9}/src/utils/mod.rs +156 -0
  73. {linthis-0.0.7 → linthis-0.0.9}/src/utils/output.rs +189 -7
  74. {linthis-0.0.7 → linthis-0.0.9}/src/utils/types.rs +55 -7
  75. {linthis-0.0.7 → linthis-0.0.9}/src/utils/walker.rs +59 -4
  76. linthis-0.0.9/tests/cli_tests.rs +3 -0
  77. linthis-0.0.9/tests/fixtures/python/bad.py +7 -0
  78. linthis-0.0.9/tests/fixtures/python/good.py +10 -0
  79. linthis-0.0.9/tests/fixtures/python/unformatted.py +3 -0
  80. linthis-0.0.9/tests/fixtures/rust/bad.rs +4 -0
  81. linthis-0.0.9/tests/integration/cache_tests.rs +221 -0
  82. linthis-0.0.9/tests/integration/check_tests.rs +243 -0
  83. linthis-0.0.9/tests/integration/common.rs +345 -0
  84. linthis-0.0.9/tests/integration/config_tests.rs +254 -0
  85. linthis-0.0.9/tests/integration/error_tests.rs +243 -0
  86. linthis-0.0.9/tests/integration/format_tests.rs +158 -0
  87. linthis-0.0.9/tests/integration/language_tests.rs +376 -0
  88. linthis-0.0.9/tests/integration/mod.rs +137 -0
  89. linthis-0.0.9/tests/integration/plugin_tests.rs +238 -0
  90. linthis-0.0.7/src/main.rs +0 -5107
  91. linthis-0.0.7/tests/integration/mod.rs +0 -3
  92. {linthis-0.0.7 → linthis-0.0.9}/.github/workflows/release.yml +0 -0
  93. {linthis-0.0.7 → linthis-0.0.9}/.gitignore +0 -0
  94. {linthis-0.0.7 → linthis-0.0.9}/CHANGELOG.md +0 -0
  95. {linthis-0.0.7 → linthis-0.0.9}/defaults/.clang-tidy +0 -0
  96. {linthis-0.0.7 → linthis-0.0.9}/defaults/config.toml +0 -0
  97. {linthis-0.0.7 → linthis-0.0.9}/dev.sh +0 -0
  98. {linthis-0.0.7 → linthis-0.0.9}/docs/AUTO_SYNC.md +0 -0
  99. {linthis-0.0.7 → linthis-0.0.9}/docs/GLOBAL_HOOKS.md +0 -0
  100. {linthis-0.0.7 → linthis-0.0.9}/docs/SELF_UPDATE.md +0 -0
  101. {linthis-0.0.7 → linthis-0.0.9}/docs/config-cli-design.md +0 -0
  102. {linthis-0.0.7 → linthis-0.0.9}/docs/init-hooks-design.md +0 -0
  103. {linthis-0.0.7 → linthis-0.0.9}/docs/plan-ruff-integration.md +0 -0
  104. {linthis-0.0.7 → linthis-0.0.9}/docs/tasks.md +0 -0
  105. {linthis-0.0.7 → linthis-0.0.9}/scripts/release.sh +0 -0
  106. {linthis-0.0.7 → linthis-0.0.9}/src/benchmark.rs +0 -0
  107. {linthis-0.0.7 → linthis-0.0.9}/src/checkers/traits.rs +0 -0
  108. {linthis-0.0.7 → linthis-0.0.9}/src/config/cli.rs +0 -0
  109. {linthis-0.0.7 → linthis-0.0.9}/src/fixers/cpplint.rs +0 -0
  110. {linthis-0.0.7 → linthis-0.0.9}/src/fixers/mod.rs +0 -0
  111. {linthis-0.0.7 → linthis-0.0.9}/src/formatters/traits.rs +0 -0
  112. {linthis-0.0.7 → linthis-0.0.9}/src/plugin/cache.rs +0 -0
  113. {linthis-0.0.7 → linthis-0.0.9}/src/plugin/fetcher.rs +0 -0
  114. {linthis-0.0.7 → linthis-0.0.9}/src/plugin/loader.rs +0 -0
  115. {linthis-0.0.7 → linthis-0.0.9}/src/plugin/manifest.rs +0 -0
  116. {linthis-0.0.7 → linthis-0.0.9}/src/plugin/registry.rs +0 -0
  117. {linthis-0.0.7 → linthis-0.0.9}/src/presets/mod.rs +0 -0
  118. {linthis-0.0.7 → linthis-0.0.9}/src/self_update.rs +0 -0
  119. {linthis-0.0.7 → linthis-0.0.9}/src/utils/language.rs +0 -0
  120. {linthis-0.0.7 → linthis-0.0.9}/src/utils/unicode.rs +0 -0
  121. {linthis-0.0.7 → linthis-0.0.9}/test-plugin-check/README.md +0 -0
  122. {linthis-0.0.7 → linthis-0.0.9}/test-plugin-check/linthis-plugin.toml +0 -0
  123. {linthis-0.0.7 → linthis-0.0.9}/tests/fixtures/test-plugin/linthis-plugin.toml +0 -0
  124. {linthis-0.0.7 → linthis-0.0.9}/tests/fixtures/test-plugin/python/ruff.toml +0 -0
  125. {linthis-0.0.7 → linthis-0.0.9}/tests/fixtures/test-plugin/rust/clippy.toml +0 -0
  126. {linthis-0.0.7 → linthis-0.0.9}/tests/fixtures/test-plugin/rust/rustfmt.toml +0 -0
  127. {linthis-0.0.7 → linthis-0.0.9}/tests/fixtures/us1/good.rs +0 -0
  128. {linthis-0.0.7 → 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.7"
500
+ version = "0.0.9"
501
501
  dependencies = [
502
502
  "anyhow",
503
503
  "chrono",
@@ -514,11 +514,13 @@ dependencies = [
514
514
  "serde",
515
515
  "serde_json",
516
516
  "serde_yaml",
517
+ "similar",
517
518
  "tempfile",
518
519
  "thiserror",
519
520
  "toml",
520
521
  "toml_edit",
521
522
  "walkdir",
523
+ "xxhash-rust",
522
524
  ]
523
525
 
524
526
  [[package]]
@@ -745,6 +747,12 @@ version = "1.3.0"
745
747
  source = "registry+https://github.com/rust-lang/crates.io-index"
746
748
  checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
747
749
 
750
+ [[package]]
751
+ name = "similar"
752
+ version = "2.7.0"
753
+ source = "registry+https://github.com/rust-lang/crates.io-index"
754
+ checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa"
755
+
748
756
  [[package]]
749
757
  name = "strsim"
750
758
  version = "0.10.0"
@@ -1104,3 +1112,9 @@ name = "wit-bindgen"
1104
1112
  version = "0.46.0"
1105
1113
  source = "registry+https://github.com/rust-lang/crates.io-index"
1106
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.7"
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"
@@ -42,9 +42,15 @@ regex = "1.8"
42
42
  # Glob pattern matching
43
43
  globset = "0.4"
44
44
 
45
+ # Diff algorithm
46
+ similar = "2.4"
47
+
45
48
  # Lazy initialization
46
49
  lazy_static = "1.4"
47
50
 
51
+ # Fast hashing (for file cache)
52
+ xxhash-rust = { version = "0.8", features = ["xxh64"] }
53
+
48
54
  # Logging
49
55
  log = "0.4"
50
56
  env_logger = "0.10"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: linthis
3
- Version: 0.0.7
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
@@ -152,15 +155,20 @@ linthis plugin add --global <alias> <git-url>
152
155
 
153
156
  ### Use Plugin
154
157
 
158
+ Plugins are automatically loaded when running linthis. After adding a plugin:
159
+
155
160
  ```bash
156
- # Use plugin configuration for linting and formatting
157
- linthis -p myplugin
158
- linthis --plugin myplugin
161
+ # Plugin configs are auto-loaded
162
+ linthis
159
163
 
160
164
  # Combine with other options
161
- linthis -p myplugin -l python -i src/
162
- linthis --plugin myplugin --check-only
163
- linthis --plugin myplugin --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
164
172
  ```
165
173
 
166
174
  ### Remove Plugin
@@ -188,8 +196,9 @@ linthis plugin list
188
196
  linthis plugin list -g
189
197
  linthis plugin list --global
190
198
 
191
- # Update plugin cache
192
- linthis --plugin-update
199
+ # Sync (update) plugins
200
+ linthis plugin sync # Sync local plugins
201
+ linthis plugin sync --global # Sync global plugins
193
202
 
194
203
  # Initialize new plugin
195
204
  linthis plugin init my-config
@@ -394,6 +403,49 @@ linthis config add -g excludes "node_modules/**"
394
403
  linthis config add -g excludes ".git/**"
395
404
  ```
396
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
+
397
449
  ### Initialize Configuration File
398
450
 
399
451
  Use the `init` subcommand to explicitly create configuration files:
@@ -423,72 +475,97 @@ All modifications preserve TOML file format and comments.
423
475
 
424
476
  ### Main Command Options
425
477
 
426
- | Short | Long | Description | Example |
427
- | ----- | ----------------------- | ---------------------------------------- | ----------------------- |
428
- | `-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` |
429
481
  | `-e` | `--exclude` | Exclude patterns (can be used multiple times) | `-e "*.test.js"` |
430
- | `-p` | `--plugin` | Use plugin (alias or Git URL) | `-p myplugin` |
431
- | `-c` | `--check-only` | Check only, no formatting | `-c` |
432
- | `-f` | `--format-only` | Format only, no checking | `-f` |
433
- | `-s` | `--staged` | Check only Git staged files | `-s` |
434
- | `-l` | `--lang` | Specify languages (comma-separated) | `-l python,rust` |
435
- | `-o` | `--output` | Output format: human, json, github-actions | `-o json` |
436
- | `-v` | `--verbose` | Verbose output | `-v` |
437
- | `-q` | `--quiet` | Quiet mode (errors only) | `-q` |
438
- | | `--config` | Specify config file path | `--config custom.toml` |
439
- | | `--init` | Initialize .linthis.toml config file | `--init` |
440
- | | `--preset` | Format preset | `--preset google` |
441
- | | `--plugin-update` | Force update plugin cache | `--plugin-update` |
442
- | | `--no-default-excludes` | Disable default exclude rules | `--no-default-excludes` |
443
- | | `--no-gitignore` | Disable .gitignore rules | `--no-gitignore` |
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` |
444
495
 
445
496
  ### Plugin Management Subcommands
446
497
 
447
- | Command | Short | Long | Description |
448
- | -------------------------- | ----- | ----------- | ------------------------- |
449
- | `plugin add <alias> <url>` | `-g` | `--global` | Add to global config |
450
- | | | `--ref` | Specify Git reference |
451
- | `plugin remove <alias>` | `-g` | `--global` | Remove from global config |
452
- | `plugin list` | `-g` | `--global` | Show global config plugins|
453
- | | `-v` | `--verbose` | Show detailed info |
454
- | `plugin clean` | | `--all` | Clean all caches |
455
- | `plugin init <name>` | | | Initialize new plugin |
456
- | `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 |
457
508
 
458
509
  ### Configuration Management Subcommands
459
510
 
460
- | Command | Short | Long | Description |
461
- | ------------------------------- | ----- | ----------- | ------------------------------- |
462
- | `config add <field> <value>` | `-g` | `--global` | Add value to array field |
463
- | `config remove <field> <value>` | `-g` | `--global` | Remove value from array field |
464
- | `config clear <field>` | `-g` | `--global` | Clear array field |
465
- | `config set <field> <value>` | `-g` | `--global` | Set scalar field value |
466
- | `config unset <field>` | `-g` | `--global` | Remove scalar field |
467
- | `config get <field>` | `-g` | `--global` | Get field value |
468
- | `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 |
469
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 |
470
525
 
471
526
  **Supported array fields**: `includes`, `excludes`, `languages`
472
527
  **Supported scalar fields**: `max_complexity`, `preset`, `verbose`
473
528
 
474
529
  ### Init Subcommand
475
530
 
476
- | Command | Short | Long | Description |
477
- | ------- | ----- | ---------- | ---------------------------------- |
478
- | `init` | `-g` | `--global` | Create global config file |
479
- | | | `--hook` | Initialize pre-commit hooks |
480
- | | `-i` | `--interactive` | Interactive mode for hooks setup |
481
- | | `-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 |
482
536
 
483
537
  **Created configuration files**:
538
+
484
539
  - Without `-g`: Creates `.linthis.toml` (current directory)
485
540
  - With `-g`: Creates `~/.linthis/config.toml` (global config)
486
541
 
487
- **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
+
488
559
  - `prek`: Rust-based pre-commit tool (faster)
489
560
  - `pre-commit`: Python-based standard tool
490
561
  - `git`: Traditional git hook
491
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
+
492
569
  ## Supported Languages
493
570
 
494
571
  | Language | Linter | Formatter |
@@ -509,45 +586,7 @@ All modifications preserve TOML file format and comments.
509
586
 
510
587
  ### Pre-commit Hook
511
588
 
512
- #### Method 1: Global Hook Template (One-time Setup)
513
-
514
- Set up a global Git hook template that applies to all new repositories:
515
-
516
- ```bash
517
- # Create global hook template
518
- linthis init -g --hook-type git
519
-
520
- # All new repos will automatically include the hook
521
- git init new-project
522
- cd new-project
523
- # .git/hooks/pre-commit is already set up!
524
- ```
525
-
526
- For existing repositories:
527
- ```bash
528
- cd existing-project
529
- git init # Re-apply template
530
- ```
531
-
532
- **Features:**
533
- - 🎯 **Smart Detection**: Only runs if project has linthis config
534
- - 🔗 **Hook Chaining**: Supports `.git/hooks/pre-commit.local` for project-specific hooks
535
- - 🚫 **Zero Interference**: Projects without linthis config are not affected
536
- - ⚡ **One-time Setup**: Works for all your new repositories
537
-
538
- **Pros:**
539
- - One-time setup for all your projects
540
- - No need to configure hooks per project
541
- - Perfect for personal development
542
- - Won't interfere with other projects or hook tools
543
-
544
- **Cons:**
545
- - Not shared with team members
546
- - Requires manual setup on each machine
547
-
548
- See [Global Hooks Guide](docs/GLOBAL_HOOKS.md) for details.
549
-
550
- #### Method 2: Using prek (Recommended for Teams)
589
+ #### Method 1: Using prek (Recommended for Teams)
551
590
 
552
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.
553
592
 
@@ -581,7 +620,7 @@ Install hook:
581
620
  prek install
582
621
  ```
583
622
 
584
- #### Method 3: Traditional Git Hook (Project-level)
623
+ #### Method 2: Traditional Git Hook (Project-level)
585
624
 
586
625
  Add to `.git/hooks/pre-commit`:
587
626
 
@@ -591,11 +630,12 @@ linthis --staged --check-only
591
630
  ```
592
631
 
593
632
  Or use linthis to create it automatically:
633
+
594
634
  ```bash
595
- linthis init --hook-type git
635
+ linthis hook install --type git
596
636
  ```
597
637
 
598
- #### Method 4: Using pre-commit Framework
638
+ #### Method 3: Using pre-commit Framework
599
639
 
600
640
  Using the [pre-commit](https://pre-commit.com/) framework:
601
641
 
@@ -695,7 +735,7 @@ git push -u origin main
695
735
 
696
736
  ```bash
697
737
  linthis plugin add company https://github.com/mycompany/linthis-standards.git
698
- linthis --plugin company
738
+ linthis # Plugin configs are auto-loaded
699
739
  ```
700
740
 
701
741
  ## FAQ
@@ -716,12 +756,13 @@ linthis -l python # Only check Python files
716
756
 
717
757
  - macOS: `~/Library/Caches/linthis/plugins`
718
758
  - Linux: `~/.cache/linthis/plugins`
719
- - Windows: `%LOCALAPPDATA%\linthis\plugins`
759
+ - Windows: `%LOCALAPPDATA%\linthis\cache\plugins`
720
760
 
721
761
  ### Q: How to update plugins?
722
762
 
723
763
  ```bash
724
- linthis --plugin-update
764
+ linthis plugin sync # Sync local plugins
765
+ linthis plugin sync --global # Sync global plugins
725
766
  ```
726
767
 
727
768
  ### Q: What is the plugin Git reference (ref) used for?