linthis 0.0.2__tar.gz → 0.0.6__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 (73) hide show
  1. linthis-0.0.6/.github/workflows/release.yml +250 -0
  2. {linthis-0.0.2 → linthis-0.0.6}/.gitignore +4 -0
  3. {linthis-0.0.2 → linthis-0.0.6}/Cargo.lock +29 -27
  4. {linthis-0.0.2 → linthis-0.0.6}/Cargo.toml +1 -1
  5. {linthis-0.0.2 → linthis-0.0.6}/PKG-INFO +6 -1
  6. {linthis-0.0.2 → linthis-0.0.6}/README.md +5 -0
  7. linthis-0.0.6/defaults/.clang-tidy +87 -0
  8. linthis-0.0.6/defaults/config.toml +107 -0
  9. linthis-0.0.6/docs/AUTO_SYNC.md +261 -0
  10. linthis-0.0.6/docs/SELF_UPDATE.md +283 -0
  11. {linthis-0.0.2 → linthis-0.0.6}/pyproject.toml +1 -1
  12. linthis-0.0.6/scripts/release.sh +177 -0
  13. linthis-0.0.6/src/checkers/cpp.rs +940 -0
  14. {linthis-0.0.2 → linthis-0.0.6}/src/checkers/go.rs +28 -2
  15. {linthis-0.0.2 → linthis-0.0.6}/src/checkers/java.rs +42 -1
  16. {linthis-0.0.2 → linthis-0.0.6}/src/checkers/python.rs +41 -2
  17. {linthis-0.0.2 → linthis-0.0.6}/src/checkers/rust.rs +6 -1
  18. {linthis-0.0.2 → linthis-0.0.6}/src/checkers/typescript.rs +45 -2
  19. {linthis-0.0.2 → linthis-0.0.6}/src/config/cli.rs +37 -28
  20. {linthis-0.0.2 → linthis-0.0.6}/src/config/mod.rs +391 -35
  21. linthis-0.0.6/src/fixers/cpplint.rs +1309 -0
  22. linthis-0.0.6/src/fixers/mod.rs +17 -0
  23. linthis-0.0.6/src/fixers/source.rs +712 -0
  24. linthis-0.0.6/src/formatters/cpp.rs +762 -0
  25. linthis-0.0.2/src/formatters/cpp.rs → linthis-0.0.6/src/formatters/java.rs +61 -13
  26. {linthis-0.0.2 → linthis-0.0.6}/src/lib.rs +184 -10
  27. {linthis-0.0.2 → linthis-0.0.6}/src/main.rs +920 -65
  28. linthis-0.0.6/src/plugin/auto_sync.rs +373 -0
  29. {linthis-0.0.2 → linthis-0.0.6}/src/plugin/cache.rs +4 -0
  30. {linthis-0.0.2 → linthis-0.0.6}/src/plugin/config_manager.rs +21 -13
  31. {linthis-0.0.2 → linthis-0.0.6}/src/plugin/fetcher.rs +90 -0
  32. {linthis-0.0.2 → linthis-0.0.6}/src/plugin/manifest.rs +69 -4
  33. linthis-0.0.6/src/plugin/mod.rs +300 -0
  34. linthis-0.0.6/src/self_update.rs +366 -0
  35. {linthis-0.0.2 → linthis-0.0.6}/src/utils/mod.rs +30 -2
  36. {linthis-0.0.2 → linthis-0.0.6}/src/utils/output.rs +91 -12
  37. linthis-0.0.6/src/utils/types.rs +549 -0
  38. linthis-0.0.6/src/utils/unicode.rs +245 -0
  39. linthis-0.0.2/.github/workflows/release.yml +0 -130
  40. linthis-0.0.2/defaults/config.toml +0 -63
  41. linthis-0.0.2/src/checkers/cpp.rs +0 -249
  42. linthis-0.0.2/src/formatters/java.rs +0 -104
  43. linthis-0.0.2/src/plugin/mod.rs +0 -138
  44. linthis-0.0.2/src/utils/types.rs +0 -197
  45. {linthis-0.0.2 → linthis-0.0.6}/CHANGELOG.md +0 -0
  46. {linthis-0.0.2 → linthis-0.0.6}/dev.sh +0 -0
  47. {linthis-0.0.2 → linthis-0.0.6}/docs/config-cli-design.md +0 -0
  48. {linthis-0.0.2 → linthis-0.0.6}/docs/init-hooks-design.md +0 -0
  49. {linthis-0.0.2 → linthis-0.0.6}/docs/plan-ruff-integration.md +0 -0
  50. {linthis-0.0.2 → linthis-0.0.6}/docs/tasks.md +0 -0
  51. {linthis-0.0.2 → linthis-0.0.6}/src/benchmark.rs +0 -0
  52. {linthis-0.0.2 → linthis-0.0.6}/src/checkers/mod.rs +0 -0
  53. {linthis-0.0.2 → linthis-0.0.6}/src/checkers/traits.rs +0 -0
  54. {linthis-0.0.2 → linthis-0.0.6}/src/formatters/go.rs +0 -0
  55. {linthis-0.0.2 → linthis-0.0.6}/src/formatters/mod.rs +0 -0
  56. {linthis-0.0.2 → linthis-0.0.6}/src/formatters/python.rs +0 -0
  57. {linthis-0.0.2 → linthis-0.0.6}/src/formatters/rust.rs +0 -0
  58. {linthis-0.0.2 → linthis-0.0.6}/src/formatters/traits.rs +0 -0
  59. {linthis-0.0.2 → linthis-0.0.6}/src/formatters/typescript.rs +0 -0
  60. {linthis-0.0.2 → linthis-0.0.6}/src/plugin/loader.rs +0 -0
  61. {linthis-0.0.2 → linthis-0.0.6}/src/plugin/registry.rs +0 -0
  62. {linthis-0.0.2 → linthis-0.0.6}/src/presets/mod.rs +0 -0
  63. {linthis-0.0.2 → linthis-0.0.6}/src/utils/language.rs +0 -0
  64. {linthis-0.0.2 → linthis-0.0.6}/src/utils/walker.rs +0 -0
  65. {linthis-0.0.2 → linthis-0.0.6}/test-plugin-check/README.md +0 -0
  66. {linthis-0.0.2 → linthis-0.0.6}/test-plugin-check/linthis-plugin.toml +0 -0
  67. {linthis-0.0.2 → linthis-0.0.6}/tests/fixtures/test-plugin/linthis-plugin.toml +0 -0
  68. {linthis-0.0.2 → linthis-0.0.6}/tests/fixtures/test-plugin/python/ruff.toml +0 -0
  69. {linthis-0.0.2 → linthis-0.0.6}/tests/fixtures/test-plugin/rust/clippy.toml +0 -0
  70. {linthis-0.0.2 → linthis-0.0.6}/tests/fixtures/test-plugin/rust/rustfmt.toml +0 -0
  71. {linthis-0.0.2 → linthis-0.0.6}/tests/fixtures/us1/good.rs +0 -0
  72. {linthis-0.0.2 → linthis-0.0.6}/tests/fixtures/us1/unformatted.rs +0 -0
  73. {linthis-0.0.2 → linthis-0.0.6}/tests/integration/mod.rs +0 -0
@@ -0,0 +1,250 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*.*.*'
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: write
11
+ id-token: write
12
+
13
+ env:
14
+ PACKAGE_NAME: linthis
15
+
16
+ jobs:
17
+ # Build wheels for Linux
18
+ linux:
19
+ name: Build Linux ${{ matrix.target }}
20
+ runs-on: ${{ matrix.runner }}
21
+ strategy:
22
+ fail-fast: false
23
+ matrix:
24
+ include:
25
+ - runner: ubuntu-latest
26
+ target: x86_64
27
+ - runner: ubuntu-24.04-arm
28
+ target: aarch64
29
+ steps:
30
+ - uses: actions/checkout@v4
31
+ - uses: actions/setup-python@v5
32
+ with:
33
+ python-version: '3.11'
34
+ - name: Build wheels
35
+ uses: PyO3/maturin-action@v1
36
+ with:
37
+ target: ${{ matrix.target }}
38
+ args: --release --locked --out dist
39
+ manylinux: '2_17'
40
+ - name: Upload wheels
41
+ uses: actions/upload-artifact@v4
42
+ with:
43
+ name: wheels-linux-${{ matrix.target }}
44
+ path: dist
45
+ - name: Archive binary
46
+ run: |
47
+ ARCH=${{ matrix.target }}
48
+ if [ "$ARCH" = "x86_64" ]; then
49
+ TARGET=x86_64-unknown-linux-gnu
50
+ else
51
+ TARGET=aarch64-unknown-linux-gnu
52
+ fi
53
+ ARCHIVE_NAME=${{ env.PACKAGE_NAME }}-$TARGET
54
+ ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz
55
+
56
+ mkdir -p $ARCHIVE_NAME
57
+ cp target/$TARGET/release/${{ env.PACKAGE_NAME }} $ARCHIVE_NAME/
58
+ tar czvf $ARCHIVE_FILE $ARCHIVE_NAME
59
+ shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256
60
+ - name: Upload binary
61
+ uses: actions/upload-artifact@v4
62
+ with:
63
+ name: binaries-linux-${{ matrix.target }}
64
+ path: |
65
+ *.tar.gz
66
+ *.sha256
67
+
68
+ # Build wheels for Windows
69
+ windows:
70
+ name: Build Windows x86_64
71
+ runs-on: windows-latest
72
+ steps:
73
+ - uses: actions/checkout@v4
74
+ - uses: actions/setup-python@v5
75
+ with:
76
+ python-version: '3.11'
77
+ - name: Build wheels
78
+ uses: PyO3/maturin-action@v1
79
+ with:
80
+ target: x86_64
81
+ args: --release --locked --out dist
82
+ - name: Upload wheels
83
+ uses: actions/upload-artifact@v4
84
+ with:
85
+ name: wheels-windows-x86_64
86
+ path: dist
87
+ - name: Archive binary
88
+ shell: bash
89
+ run: |
90
+ TARGET=x86_64-pc-windows-msvc
91
+ ARCHIVE_NAME=${{ env.PACKAGE_NAME }}-$TARGET
92
+ ARCHIVE_FILE=$ARCHIVE_NAME.zip
93
+
94
+ mkdir -p $ARCHIVE_NAME
95
+ cp target/$TARGET/release/${{ env.PACKAGE_NAME }}.exe $ARCHIVE_NAME/
96
+ 7z a $ARCHIVE_FILE $ARCHIVE_NAME
97
+ sha256sum $ARCHIVE_FILE > $ARCHIVE_FILE.sha256
98
+ - name: Upload binary
99
+ uses: actions/upload-artifact@v4
100
+ with:
101
+ name: binaries-windows-x86_64
102
+ path: |
103
+ *.zip
104
+ *.sha256
105
+
106
+ # Build wheels for macOS
107
+ macos:
108
+ name: Build macOS ${{ matrix.target }}
109
+ runs-on: ${{ matrix.runner }}
110
+ strategy:
111
+ fail-fast: false
112
+ matrix:
113
+ include:
114
+ - runner: macos-15-intel
115
+ target: x86_64
116
+ - runner: macos-14
117
+ target: aarch64
118
+ steps:
119
+ - uses: actions/checkout@v4
120
+ - uses: actions/setup-python@v5
121
+ with:
122
+ python-version: '3.11'
123
+ - name: Build wheels
124
+ uses: PyO3/maturin-action@v1
125
+ with:
126
+ target: ${{ matrix.target }}
127
+ args: --release --locked --out dist
128
+ - name: Upload wheels
129
+ uses: actions/upload-artifact@v4
130
+ with:
131
+ name: wheels-macos-${{ matrix.target }}
132
+ path: dist
133
+ - name: Archive binary
134
+ run: |
135
+ ARCH=${{ matrix.target }}
136
+ if [ "$ARCH" = "x86_64" ]; then
137
+ TARGET=x86_64-apple-darwin
138
+ else
139
+ TARGET=aarch64-apple-darwin
140
+ fi
141
+ ARCHIVE_NAME=${{ env.PACKAGE_NAME }}-$TARGET
142
+ ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz
143
+
144
+ mkdir -p $ARCHIVE_NAME
145
+ cp target/$TARGET/release/${{ env.PACKAGE_NAME }} $ARCHIVE_NAME/
146
+ tar czvf $ARCHIVE_FILE $ARCHIVE_NAME
147
+ shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256
148
+ - name: Upload binary
149
+ uses: actions/upload-artifact@v4
150
+ with:
151
+ name: binaries-macos-${{ matrix.target }}
152
+ path: |
153
+ *.tar.gz
154
+ *.sha256
155
+
156
+ # Build source distribution
157
+ sdist:
158
+ name: Build sdist
159
+ runs-on: ubuntu-latest
160
+ steps:
161
+ - uses: actions/checkout@v4
162
+ - name: Build sdist
163
+ uses: PyO3/maturin-action@v1
164
+ with:
165
+ command: sdist
166
+ args: --out dist
167
+ - name: Upload sdist
168
+ uses: actions/upload-artifact@v4
169
+ with:
170
+ name: wheels-sdist
171
+ path: dist
172
+
173
+ # Create GitHub Release
174
+ github-release:
175
+ name: Create GitHub Release
176
+ runs-on: ubuntu-latest
177
+ if: startsWith(github.ref, 'refs/tags/')
178
+ needs: [linux, windows, macos, sdist]
179
+ steps:
180
+ - uses: actions/checkout@v4
181
+ - name: Download all binaries
182
+ uses: actions/download-artifact@v4
183
+ with:
184
+ pattern: binaries-*
185
+ path: binaries
186
+ merge-multiple: true
187
+ - name: Prepare release body
188
+ id: release_body
189
+ run: |
190
+ VERSION=${GITHUB_REF_NAME#v}
191
+ cat << EOF > release_body.md
192
+ ## Installation
193
+
194
+ \`\`\`bash
195
+ pip install linthis==$VERSION
196
+ # or
197
+ pip install --upgrade linthis
198
+ \`\`\`
199
+
200
+ ## Quick Start
201
+
202
+ \`\`\`bash
203
+ # Run linthis
204
+ linthis [-i <path>]
205
+ \`\`\`
206
+
207
+ See [CHANGELOG.md](CHANGELOG.md) for details.
208
+ EOF
209
+ - name: Create Release
210
+ uses: softprops/action-gh-release@v2
211
+ with:
212
+ files: binaries/*
213
+ generate_release_notes: true
214
+ body_path: release_body.md
215
+ draft: false
216
+ prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc') }}
217
+ env:
218
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
219
+
220
+ # Publish to PyPI
221
+ publish-pypi:
222
+ name: Publish to PyPI
223
+ runs-on: ubuntu-latest
224
+ if: startsWith(github.ref, 'refs/tags/')
225
+ needs: [linux, windows, macos, sdist]
226
+ permissions:
227
+ id-token: write
228
+ steps:
229
+ - uses: actions/download-artifact@v4
230
+ with:
231
+ pattern: wheels-*
232
+ merge-multiple: true
233
+ path: dist
234
+ - name: Publish to PyPI
235
+ uses: pypa/gh-action-pypi-publish@release/v1
236
+
237
+ # Publish to crates.io
238
+ publish-crates:
239
+ name: Publish to crates.io
240
+ runs-on: ubuntu-latest
241
+ if: startsWith(github.ref, 'refs/tags/')
242
+ steps:
243
+ - uses: actions/checkout@v4
244
+ - uses: dtolnay/rust-toolchain@stable
245
+ - name: Run tests
246
+ run: cargo test --locked
247
+ - name: Publish to crates.io
248
+ env:
249
+ CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
250
+ run: cargo publish --locked
@@ -41,3 +41,7 @@ Thumbs.db
41
41
  *.so
42
42
  *.dylib
43
43
  *.dll
44
+
45
+ # Project
46
+ .linthis/
47
+
@@ -2,15 +2,6 @@
2
2
  # It is not intended for manual editing.
3
3
  version = 4
4
4
 
5
- [[package]]
6
- name = "aho-corasick"
7
- version = "0.7.20"
8
- source = "registry+https://github.com/rust-lang/crates.io-index"
9
- checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac"
10
- dependencies = [
11
- "memchr",
12
- ]
13
-
14
5
  [[package]]
15
6
  name = "aho-corasick"
16
7
  version = "1.1.4"
@@ -115,9 +106,9 @@ checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3"
115
106
 
116
107
  [[package]]
117
108
  name = "bstr"
118
- version = "1.6.0"
109
+ version = "1.12.1"
119
110
  source = "registry+https://github.com/rust-lang/crates.io-index"
120
- checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05"
111
+ checksum = "63044e1ae8e69f3b5a92c736ca6269b8d12fa7efe39bf34ddb06d102cf0e2cab"
121
112
  dependencies = [
122
113
  "memchr",
123
114
  "serde",
@@ -326,12 +317,6 @@ version = "0.1.5"
326
317
  source = "registry+https://github.com/rust-lang/crates.io-index"
327
318
  checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844"
328
319
 
329
- [[package]]
330
- name = "fnv"
331
- version = "1.0.7"
332
- source = "registry+https://github.com/rust-lang/crates.io-index"
333
- checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
334
-
335
320
  [[package]]
336
321
  name = "fs2"
337
322
  version = "0.4.3"
@@ -367,15 +352,15 @@ dependencies = [
367
352
 
368
353
  [[package]]
369
354
  name = "globset"
370
- version = "0.4.10"
355
+ version = "0.4.14"
371
356
  source = "registry+https://github.com/rust-lang/crates.io-index"
372
- checksum = "029d74589adefde59de1a0c4f4732695c32805624aec7b68d91503d4dba79afc"
357
+ checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1"
373
358
  dependencies = [
374
- "aho-corasick 0.7.20",
359
+ "aho-corasick",
375
360
  "bstr",
376
- "fnv",
377
361
  "log",
378
- "regex",
362
+ "regex-automata",
363
+ "regex-syntax 0.8.8",
379
364
  ]
380
365
 
381
366
  [[package]]
@@ -512,7 +497,7 @@ dependencies = [
512
497
 
513
498
  [[package]]
514
499
  name = "linthis"
515
- version = "0.0.2"
500
+ version = "0.0.6"
516
501
  dependencies = [
517
502
  "anyhow",
518
503
  "chrono",
@@ -544,9 +529,9 @@ checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039"
544
529
 
545
530
  [[package]]
546
531
  name = "log"
547
- version = "0.4.18"
532
+ version = "0.4.29"
548
533
  source = "registry+https://github.com/rust-lang/crates.io-index"
549
- checksum = "518ef76f2f87365916b142844c16d8fefd85039bc5699050210a7778ee1cd1de"
534
+ checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
550
535
 
551
536
  [[package]]
552
537
  name = "memchr"
@@ -648,9 +633,20 @@ version = "1.8.4"
648
633
  source = "registry+https://github.com/rust-lang/crates.io-index"
649
634
  checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f"
650
635
  dependencies = [
651
- "aho-corasick 1.1.4",
636
+ "aho-corasick",
652
637
  "memchr",
653
- "regex-syntax",
638
+ "regex-syntax 0.7.5",
639
+ ]
640
+
641
+ [[package]]
642
+ name = "regex-automata"
643
+ version = "0.4.13"
644
+ source = "registry+https://github.com/rust-lang/crates.io-index"
645
+ checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c"
646
+ dependencies = [
647
+ "aho-corasick",
648
+ "memchr",
649
+ "regex-syntax 0.8.8",
654
650
  ]
655
651
 
656
652
  [[package]]
@@ -659,6 +655,12 @@ version = "0.7.5"
659
655
  source = "registry+https://github.com/rust-lang/crates.io-index"
660
656
  checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da"
661
657
 
658
+ [[package]]
659
+ name = "regex-syntax"
660
+ version = "0.8.8"
661
+ source = "registry+https://github.com/rust-lang/crates.io-index"
662
+ checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58"
663
+
662
664
  [[package]]
663
665
  name = "rustix"
664
666
  version = "1.1.2"
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "linthis"
3
- version = "0.0.2"
3
+ version = "0.0.6"
4
4
  edition = "2021"
5
5
  authors = ["zhlinh"]
6
6
  description = "A fast, cross-platform multi-language linter and formatter"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: linthis
3
- Version: 0.0.2
3
+ Version: 0.0.6
4
4
  Classifier: Development Status :: 3 - Alpha
5
5
  Classifier: Environment :: Console
6
6
  Classifier: Intended Audience :: Developers
@@ -688,6 +688,11 @@ The ref can specify:
688
688
 
689
689
  This allows you to lock plugin versions or use development versions.
690
690
 
691
+ ## Documentation
692
+
693
+ - [Plugin Auto-Sync](docs/AUTO_SYNC.md) - Automatic plugin synchronization (inspired by oh-my-zsh)
694
+ - [Self Auto-Update](docs/SELF_UPDATE.md) - Automatic self-update functionality
695
+
691
696
  ## Development
692
697
 
693
698
  ### Build
@@ -666,6 +666,11 @@ The ref can specify:
666
666
 
667
667
  This allows you to lock plugin versions or use development versions.
668
668
 
669
+ ## Documentation
670
+
671
+ - [Plugin Auto-Sync](docs/AUTO_SYNC.md) - Automatic plugin synchronization (inspired by oh-my-zsh)
672
+ - [Self Auto-Update](docs/SELF_UPDATE.md) - Automatic self-update functionality
673
+
669
674
  ## Development
670
675
 
671
676
  ### Build
@@ -0,0 +1,87 @@
1
+ # clang-tidy configuration for linthis
2
+ # Reference: https://clang.llvm.org/extra/clang-tidy/
3
+
4
+ ---
5
+ # 启用的检查规则
6
+ Checks: >
7
+ -*,
8
+ bugprone-*,
9
+ clang-analyzer-*,
10
+ cppcoreguidelines-*,
11
+ google-*,
12
+ misc-*,
13
+ modernize-*,
14
+ performance-*,
15
+ readability-*,
16
+ -modernize-use-trailing-return-type,
17
+ -readability-magic-numbers,
18
+ -cppcoreguidelines-avoid-magic-numbers,
19
+ -google-readability-todo,
20
+ -readability-identifier-length,
21
+ -cppcoreguidelines-pro-bounds-array-to-pointer-decay
22
+
23
+ # 将警告视为错误的规则 (可选)
24
+ WarningsAsErrors: ''
25
+
26
+ # 头文件过滤正则表达式
27
+ HeaderFilterRegex: '.*'
28
+
29
+ # 分析系统头文件
30
+ AnalyzeTemporaryDtors: false
31
+
32
+ # 格式化风格 (用于自动修复)
33
+ FormatStyle: 'google'
34
+
35
+ # 检查选项
36
+ CheckOptions:
37
+ # readability-identifier-naming: 命名规范
38
+ - key: readability-identifier-naming.ClassCase
39
+ value: CamelCase
40
+ - key: readability-identifier-naming.StructCase
41
+ value: CamelCase
42
+ - key: readability-identifier-naming.EnumCase
43
+ value: CamelCase
44
+ - key: readability-identifier-naming.FunctionCase
45
+ value: CamelCase
46
+ - key: readability-identifier-naming.MethodCase
47
+ value: CamelCase
48
+ - key: readability-identifier-naming.VariableCase
49
+ value: lower_case
50
+ - key: readability-identifier-naming.ParameterCase
51
+ value: lower_case
52
+ - key: readability-identifier-naming.MemberCase
53
+ value: lower_case
54
+ - key: readability-identifier-naming.MemberSuffix
55
+ value: '_'
56
+ - key: readability-identifier-naming.ConstantCase
57
+ value: CamelCase
58
+ - key: readability-identifier-naming.ConstantPrefix
59
+ value: 'k'
60
+ - key: readability-identifier-naming.GlobalConstantCase
61
+ value: CamelCase
62
+ - key: readability-identifier-naming.GlobalConstantPrefix
63
+ value: 'k'
64
+ - key: readability-identifier-naming.MacroDefinitionCase
65
+ value: UPPER_CASE
66
+ - key: readability-identifier-naming.NamespaceCase
67
+ value: lower_case
68
+
69
+ # modernize 相关选项
70
+ - key: modernize-use-nullptr.NullMacros
71
+ value: 'NULL'
72
+ - key: modernize-loop-convert.MinConfidence
73
+ value: reasonable
74
+ - key: modernize-pass-by-value.IncludeStyle
75
+ value: google
76
+
77
+ # performance 相关选项
78
+ - key: performance-move-const-arg.CheckTriviallyCopyableMove
79
+ value: true
80
+
81
+ # misc 相关选项
82
+ - key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
83
+ value: true
84
+
85
+ # cppcoreguidelines 相关选项
86
+ - key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor
87
+ value: true
@@ -0,0 +1,107 @@
1
+ # Linthis Default Configuration
2
+ # This file contains built-in defaults that are applied when no user/project config exists.
3
+
4
+ # Maximum cyclomatic complexity threshold
5
+ max_complexity = 20
6
+
7
+ # Default exclusion patterns
8
+ exclude = [
9
+ ".git/**",
10
+ ".hg/**",
11
+ ".svn/**",
12
+ "node_modules/**",
13
+ "target/**",
14
+ "vendor/**",
15
+ "build/**",
16
+ "dist/**",
17
+ "__pycache__/**",
18
+ "*.pyc",
19
+ "*.pyo",
20
+ ".venv/**",
21
+ "venv/**",
22
+ ".idea/**",
23
+ ".vscode/**",
24
+ "*.min.js",
25
+ "*.min.css",
26
+ "**/Pods/**",
27
+ ]
28
+
29
+ # Output settings
30
+ [output]
31
+ format = "human" # human, json, github-actions
32
+ color = "auto" # auto, always, never
33
+
34
+ # Parallel processing
35
+ [parallel]
36
+ enabled = true
37
+ jobs = 0 # 0 = auto-detect CPU count
38
+
39
+ # Python settings (uses ruff for both linting and formatting)
40
+ [python]
41
+ # Ruff is used for both linting and formatting (10-100x faster than flake8+black)
42
+ linter = "ruff"
43
+ formatter = "ruff"
44
+ line_length = 120
45
+ target_version = "py38"
46
+
47
+ # Rust settings
48
+ [rust]
49
+ linter = "clippy"
50
+ formatter = "rustfmt"
51
+
52
+ # TypeScript/JavaScript settings
53
+ [typescript]
54
+ linter = "eslint"
55
+ formatter = "prettier"
56
+
57
+ # Go settings
58
+ [go]
59
+ linter = "go vet"
60
+ formatter = "gofmt"
61
+
62
+ # C/C++ settings
63
+ [cpp]
64
+ # Linter: "clang-tidy" (preferred, more powerful) or "cpplint" (fallback)
65
+ linter = "clang-tidy"
66
+ # Formatter: clang-format for code style, clang-tidy --fix for lint fixes
67
+ formatter = "clang-format"
68
+ # Style for clang-format (google, llvm, chromium, mozilla, webkit)
69
+ style = "google"
70
+ # Enable clang-tidy --fix during format phase (fixes C-style casts, nullptr, etc.)
71
+ clang_tidy_fix = true
72
+ # Enable cpplint fixer during format phase (fixes header guards, TODOs, etc.)
73
+ cpplint_fix = true
74
+ # Directory containing compile_commands.json (optional, auto-detected if not set)
75
+ # Auto-detection searches up to 6 levels: cmake*/, build*/, out*/, *_build/, *-build/
76
+ # and platform dirs: android/, ios/, arm*/, x86*/, debug/, release/, static/, shared/
77
+ # compile_commands_dir = "cmake_build/debug/Android/static/arm64-v8a"
78
+ # Cpplint line length (default: 80, common values: 100, 120)
79
+ linelength = 120
80
+ # Cpplint filter rules (comma-separated, -category to disable, +category to enable)
81
+ # cpplint_filter = "-build/c++11,-build/c++14"
82
+
83
+ # Cpplint fixer settings
84
+ [cpp.cpplint_fix]
85
+ # Header guard mode: "fix_name" (default) or "pragma_once"
86
+ header_guard_mode = "fix_name"
87
+ # Username for TODO comments (default: git user.name or $USER)
88
+ # todo_username = "your_username"
89
+ # Copyright template (optional, with {year} placeholder)
90
+ # copyright_template = "// Copyright {year} Your Company. All rights reserved."
91
+ # Header guard prefix (optional)
92
+ # header_guard_prefix = "MYPROJECT_"
93
+
94
+ # Objective-C settings (different from C++)
95
+ [oc]
96
+ # Cpplint line length for OC
97
+ linelength = 120
98
+ # Cpplint filter rules - disable checks not applicable to Objective-C
99
+ cpplint_filter = "-build/c++11,-build/c++14,-build/header_guard,-build/include,-legal/copyright,-readability/casting,-runtime/references,-runtime/int,-whitespace/braces,-whitespace/blank_line,-readability/braces,-whitespace/empty_if_body"
100
+
101
+ # Plugin settings
102
+ [plugin]
103
+ # Auto-sync settings (inspired by oh-my-zsh auto-update)
104
+ [plugin.auto_sync]
105
+ enabled = true # Enable automatic plugin synchronization
106
+ mode = "prompt" # Sync mode: "auto" (automatic), "prompt" (ask before sync), "disabled"
107
+ interval_days = 7 # Check for updates every N days