linthis 0.0.6__py3-none-win_amd64.whl → 0.0.8__py3-none-win_amd64.whl
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.
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: linthis
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.8
|
|
4
4
|
Classifier: Development Status :: 3 - Alpha
|
|
5
5
|
Classifier: Environment :: Console
|
|
6
6
|
Classifier: Intended Audience :: Developers
|
|
@@ -16,9 +16,9 @@ Author: zhlinh
|
|
|
16
16
|
License: MIT
|
|
17
17
|
Requires-Python: >=3.8
|
|
18
18
|
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
19
|
-
Project-URL: Repository, https://github.com/zhlinh/linthis
|
|
20
|
-
Project-URL: Homepage, https://github.com/zhlinh/linthis
|
|
21
19
|
Project-URL: Documentation, https://docs.rs/linthis
|
|
20
|
+
Project-URL: Homepage, https://github.com/zhlinh/linthis
|
|
21
|
+
Project-URL: Repository, https://github.com/zhlinh/linthis
|
|
22
22
|
|
|
23
23
|
# linthis
|
|
24
24
|
|
|
@@ -76,14 +76,17 @@ linthis init
|
|
|
76
76
|
# Create global configuration file
|
|
77
77
|
linthis init -g
|
|
78
78
|
|
|
79
|
-
#
|
|
80
|
-
linthis init --hook
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
# Create global git hook template (for all new repos)
|
|
80
|
+
linthis init -g --hook-type git
|
|
81
|
+
|
|
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
|
|
83
86
|
|
|
84
87
|
# Force overwrite existing files
|
|
85
88
|
linthis init --force
|
|
86
|
-
linthis init --hook prek -f
|
|
89
|
+
linthis init --hook-type prek -f
|
|
87
90
|
```
|
|
88
91
|
|
|
89
92
|
### Basic Usage
|
|
@@ -149,15 +152,16 @@ linthis plugin add --global <alias> <git-url>
|
|
|
149
152
|
|
|
150
153
|
### Use Plugin
|
|
151
154
|
|
|
155
|
+
Plugins are automatically loaded when running linthis. After adding a plugin:
|
|
156
|
+
|
|
152
157
|
```bash
|
|
153
|
-
#
|
|
154
|
-
linthis
|
|
155
|
-
linthis --plugin myplugin
|
|
158
|
+
# Plugin configs are auto-loaded
|
|
159
|
+
linthis
|
|
156
160
|
|
|
157
161
|
# Combine with other options
|
|
158
|
-
linthis -
|
|
159
|
-
linthis --
|
|
160
|
-
linthis --
|
|
162
|
+
linthis -l python -i src/
|
|
163
|
+
linthis --check-only
|
|
164
|
+
linthis --staged
|
|
161
165
|
```
|
|
162
166
|
|
|
163
167
|
### Remove Plugin
|
|
@@ -185,8 +189,9 @@ linthis plugin list
|
|
|
185
189
|
linthis plugin list -g
|
|
186
190
|
linthis plugin list --global
|
|
187
191
|
|
|
188
|
-
#
|
|
189
|
-
linthis
|
|
192
|
+
# Sync (update) plugins
|
|
193
|
+
linthis plugin sync # Sync local plugins
|
|
194
|
+
linthis plugin sync --global # Sync global plugins
|
|
190
195
|
|
|
191
196
|
# Initialize new plugin
|
|
192
197
|
linthis plugin init my-config
|
|
@@ -424,7 +429,6 @@ All modifications preserve TOML file format and comments.
|
|
|
424
429
|
| ----- | ----------------------- | ---------------------------------------- | ----------------------- |
|
|
425
430
|
| `-i` | `--include` | Specify files or directories to check | `-i src -i lib` |
|
|
426
431
|
| `-e` | `--exclude` | Exclude patterns (can be used multiple times) | `-e "*.test.js"` |
|
|
427
|
-
| `-p` | `--plugin` | Use plugin (alias or Git URL) | `-p myplugin` |
|
|
428
432
|
| `-c` | `--check-only` | Check only, no formatting | `-c` |
|
|
429
433
|
| `-f` | `--format-only` | Format only, no checking | `-f` |
|
|
430
434
|
| `-s` | `--staged` | Check only Git staged files | `-s` |
|
|
@@ -435,9 +439,9 @@ All modifications preserve TOML file format and comments.
|
|
|
435
439
|
| | `--config` | Specify config file path | `--config custom.toml` |
|
|
436
440
|
| | `--init` | Initialize .linthis.toml config file | `--init` |
|
|
437
441
|
| | `--preset` | Format preset | `--preset google` |
|
|
438
|
-
| | `--plugin-update` | Force update plugin cache | `--plugin-update` |
|
|
439
442
|
| | `--no-default-excludes` | Disable default exclude rules | `--no-default-excludes` |
|
|
440
443
|
| | `--no-gitignore` | Disable .gitignore rules | `--no-gitignore` |
|
|
444
|
+
| | `--no-plugin` | Skip loading plugins, use default config | `--no-plugin` |
|
|
441
445
|
|
|
442
446
|
### Plugin Management Subcommands
|
|
443
447
|
|
|
@@ -506,7 +510,45 @@ All modifications preserve TOML file format and comments.
|
|
|
506
510
|
|
|
507
511
|
### Pre-commit Hook
|
|
508
512
|
|
|
509
|
-
#### Method 1:
|
|
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)
|
|
510
552
|
|
|
511
553
|
[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.
|
|
512
554
|
|
|
@@ -540,7 +582,7 @@ Install hook:
|
|
|
540
582
|
prek install
|
|
541
583
|
```
|
|
542
584
|
|
|
543
|
-
#### Method
|
|
585
|
+
#### Method 3: Traditional Git Hook (Project-level)
|
|
544
586
|
|
|
545
587
|
Add to `.git/hooks/pre-commit`:
|
|
546
588
|
|
|
@@ -549,7 +591,12 @@ Add to `.git/hooks/pre-commit`:
|
|
|
549
591
|
linthis --staged --check-only
|
|
550
592
|
```
|
|
551
593
|
|
|
552
|
-
|
|
594
|
+
Or use linthis to create it automatically:
|
|
595
|
+
```bash
|
|
596
|
+
linthis init --hook-type git
|
|
597
|
+
```
|
|
598
|
+
|
|
599
|
+
#### Method 4: Using pre-commit Framework
|
|
553
600
|
|
|
554
601
|
Using the [pre-commit](https://pre-commit.com/) framework:
|
|
555
602
|
|
|
@@ -649,7 +696,7 @@ git push -u origin main
|
|
|
649
696
|
|
|
650
697
|
```bash
|
|
651
698
|
linthis plugin add company https://github.com/mycompany/linthis-standards.git
|
|
652
|
-
linthis
|
|
699
|
+
linthis # Plugin configs are auto-loaded
|
|
653
700
|
```
|
|
654
701
|
|
|
655
702
|
## FAQ
|
|
@@ -675,7 +722,8 @@ linthis -l python # Only check Python files
|
|
|
675
722
|
### Q: How to update plugins?
|
|
676
723
|
|
|
677
724
|
```bash
|
|
678
|
-
linthis
|
|
725
|
+
linthis plugin sync # Sync local plugins
|
|
726
|
+
linthis plugin sync --global # Sync global plugins
|
|
679
727
|
```
|
|
680
728
|
|
|
681
729
|
### Q: What is the plugin Git reference (ref) used for?
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
linthis-0.0.8.data\scripts\linthis.exe,sha256=3wDQShAjOELcr0AILL-CNY2mmYYpW7_cLElXUtGO89o,5782528
|
|
2
|
+
linthis-0.0.8.dist-info\METADATA,sha256=A2PVwVPNC_emY28ouYQ-0fLgssuEplJ6-sEF6zUvf2k,21154
|
|
3
|
+
linthis-0.0.8.dist-info\WHEEL,sha256=jsSEiVNsW1dJj5gDaReR40i7mhgBjWtms6nAD6EViXU,94
|
|
4
|
+
linthis-0.0.8.dist-info\RECORD,,
|
linthis-0.0.6.dist-info/RECORD
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
linthis-0.0.6.data/scripts/linthis.exe,sha256=hC4BwN5qOap1_G7fVjuIqrQpMfdc6ruFwcQidpyhlHY,5220352
|
|
2
|
-
linthis-0.0.6.dist-info/METADATA,sha256=V_eqWKRdnpsoPMw6GAEsFRrMPbuz0Q1F-IMCt5bcyvU,19779
|
|
3
|
-
linthis-0.0.6.dist-info/WHEEL,sha256=14-pPWiwFoCAtTgD4hWnxHSfZQqe6Zt0DfwcROvwlzs,94
|
|
4
|
-
linthis-0.0.6.dist-info/RECORD,,
|