@trebired/code-discipline 2.3.0 → 3.1.0
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.
- package/CHANGELOG.md +20 -0
- package/README.md +49 -2
- package/dist/checks/fix-folderization.js +1 -1
- package/dist/checks/index.d.ts +1 -0
- package/dist/checks/index.d.ts.map +1 -1
- package/dist/checks/index.js +93 -70
- package/dist/checks/index.js.map +1 -1
- package/dist/checks/rule-slugs.d.ts +3 -3
- package/dist/checks/rule-slugs.d.ts.map +1 -1
- package/dist/checks/rule-slugs.js +12 -8
- package/dist/checks/rule-slugs.js.map +1 -1
- package/dist/checks/rules/comments/ranges.d.ts +10 -0
- package/dist/checks/rules/comments/ranges.d.ts.map +1 -0
- package/dist/checks/rules/{comment-stripping.js → comments/ranges.js} +51 -107
- package/dist/checks/rules/comments/ranges.js.map +1 -0
- package/dist/checks/rules/{comment-stripping.d.ts → comments/stripping.d.ts} +3 -2
- package/dist/checks/rules/comments/stripping.d.ts.map +1 -0
- package/dist/checks/rules/comments/stripping.js +81 -0
- package/dist/checks/rules/comments/stripping.js.map +1 -0
- package/dist/checks/rules/dry/candidates.d.ts +8 -0
- package/dist/checks/rules/dry/candidates.d.ts.map +1 -0
- package/dist/checks/rules/dry/candidates.js +98 -0
- package/dist/checks/rules/dry/candidates.js.map +1 -0
- package/dist/checks/rules/dry/fingerprint.d.ts +15 -0
- package/dist/checks/rules/dry/fingerprint.d.ts.map +1 -0
- package/dist/checks/rules/dry/fingerprint.js +80 -0
- package/dist/checks/rules/dry/fingerprint.js.map +1 -0
- package/dist/checks/rules/dry/fix.d.ts +5 -0
- package/dist/checks/rules/dry/fix.d.ts.map +1 -0
- package/dist/checks/rules/dry/fix.js +252 -0
- package/dist/checks/rules/dry/fix.js.map +1 -0
- package/dist/checks/rules/dry/helpers.d.ts +5 -0
- package/dist/checks/rules/dry/helpers.d.ts.map +1 -0
- package/dist/checks/rules/dry/helpers.js +99 -0
- package/dist/checks/rules/dry/helpers.js.map +1 -0
- package/dist/checks/rules/dry/index.d.ts +7 -0
- package/dist/checks/rules/dry/index.d.ts.map +1 -0
- package/dist/checks/rules/dry/index.js +14 -0
- package/dist/checks/rules/dry/index.js.map +1 -0
- package/dist/checks/rules/dry/model.d.ts +37 -0
- package/dist/checks/rules/dry/model.d.ts.map +1 -0
- package/dist/checks/rules/dry/model.js +16 -0
- package/dist/checks/rules/dry/model.js.map +1 -0
- package/dist/checks/rules/dry/serialize/bindings.d.ts +8 -0
- package/dist/checks/rules/dry/serialize/bindings.d.ts.map +1 -0
- package/dist/checks/rules/dry/serialize/bindings.js +62 -0
- package/dist/checks/rules/dry/serialize/bindings.js.map +1 -0
- package/dist/checks/rules/dry/serialize/context.d.ts +18 -0
- package/dist/checks/rules/dry/serialize/context.d.ts.map +1 -0
- package/dist/checks/rules/dry/serialize/context.js +103 -0
- package/dist/checks/rules/dry/serialize/context.js.map +1 -0
- package/dist/checks/rules/dry/serialize/expressions.d.ts +10 -0
- package/dist/checks/rules/dry/serialize/expressions.d.ts.map +1 -0
- package/dist/checks/rules/dry/serialize/expressions.js +161 -0
- package/dist/checks/rules/dry/serialize/expressions.js.map +1 -0
- package/dist/checks/rules/dry/serialize/node.d.ts +5 -0
- package/dist/checks/rules/dry/serialize/node.d.ts.map +1 -0
- package/dist/checks/rules/dry/serialize/node.js +43 -0
- package/dist/checks/rules/dry/serialize/node.js.map +1 -0
- package/dist/checks/rules/dry/serialize/statements.d.ts +7 -0
- package/dist/checks/rules/dry/serialize/statements.d.ts.map +1 -0
- package/dist/checks/rules/dry/serialize/statements.js +99 -0
- package/dist/checks/rules/dry/serialize/statements.js.map +1 -0
- package/dist/checks/rules/evasion-guards/functions.d.ts +14 -0
- package/dist/checks/rules/evasion-guards/functions.d.ts.map +1 -0
- package/dist/checks/rules/evasion-guards/functions.js +83 -0
- package/dist/checks/rules/evasion-guards/functions.js.map +1 -0
- package/dist/checks/rules/evasion-guards/index.d.ts +6 -0
- package/dist/checks/rules/evasion-guards/index.d.ts.map +1 -0
- package/dist/checks/rules/evasion-guards/index.js +126 -0
- package/dist/checks/rules/evasion-guards/index.js.map +1 -0
- package/dist/checks/rules/evasion-guards/runtime.d.ts +6 -0
- package/dist/checks/rules/evasion-guards/runtime.d.ts.map +1 -0
- package/dist/checks/rules/evasion-guards/runtime.js +51 -0
- package/dist/checks/rules/evasion-guards/runtime.js.map +1 -0
- package/dist/checks/rules/evasion-guards/strip.d.ts +11 -0
- package/dist/checks/rules/evasion-guards/strip.d.ts.map +1 -0
- package/dist/checks/rules/evasion-guards/strip.js +89 -0
- package/dist/checks/rules/evasion-guards/strip.js.map +1 -0
- package/dist/checks/rules/folderize/compound-files.d.ts +6 -0
- package/dist/checks/rules/folderize/compound-files.d.ts.map +1 -0
- package/dist/checks/rules/{folderize-compound-files.js → folderize/compound-files.js} +10 -2
- package/dist/checks/rules/folderize/compound-files.js.map +1 -0
- package/dist/checks/rules/{folderize-plan.d.ts → folderize/plan.d.ts} +3 -3
- package/dist/checks/rules/folderize/plan.d.ts.map +1 -0
- package/dist/checks/rules/{folderize-plan.js → folderize/plan.js} +2 -2
- package/dist/checks/rules/folderize/plan.js.map +1 -0
- package/dist/checks/rules/max/file-lines.d.ts +6 -0
- package/dist/checks/rules/max/file-lines.d.ts.map +1 -0
- package/dist/checks/rules/{max-file-lines.js → max/file-lines.js} +9 -1
- package/dist/checks/rules/max/file-lines.js.map +1 -0
- package/dist/checks/rules/max/function-lines.d.ts +6 -0
- package/dist/checks/rules/max/function-lines.d.ts.map +1 -0
- package/dist/checks/rules/{max-function-lines.js → max/function-lines.js} +79 -61
- package/dist/checks/rules/max/function-lines.js.map +1 -0
- package/dist/checks/rules/remove-comments.d.ts.map +1 -1
- package/dist/checks/rules/remove-comments.js +10 -1
- package/dist/checks/rules/remove-comments.js.map +1 -1
- package/dist/checks/types.d.ts +25 -2
- package/dist/checks/types.d.ts.map +1 -1
- package/dist/cli/progress.d.ts +11 -0
- package/dist/cli/progress.d.ts.map +1 -0
- package/dist/cli/progress.js +65 -0
- package/dist/cli/progress.js.map +1 -0
- package/dist/cli/run-cli.d.ts.map +1 -1
- package/dist/cli/run-cli.js +91 -66
- package/dist/cli/run-cli.js.map +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +68 -62
- package/dist/config/index.js.map +1 -1
- package/dist/config/{normalize-check-options.d.ts → normalize/check-options.d.ts} +2 -2
- package/dist/config/normalize/check-options.d.ts.map +1 -0
- package/dist/config/{normalize-check-options.js → normalize/check-options.js} +6 -5
- package/dist/config/normalize/check-options.js.map +1 -0
- package/dist/config/{normalize-rule-options.d.ts → normalize/rule-options.d.ts} +9 -8
- package/dist/config/normalize/rule-options.d.ts.map +1 -0
- package/dist/config/{normalize-rule-options.js → normalize/rule-options.js} +37 -4
- package/dist/config/normalize/rule-options.js.map +1 -0
- package/dist/config/{normalize-source-options.d.ts → normalize/source-options.d.ts} +4 -2
- package/dist/config/normalize/source-options.d.ts.map +1 -0
- package/dist/config/{normalize-source-options.js → normalize/source-options.js} +6 -5
- package/dist/config/normalize/source-options.js.map +1 -0
- package/dist/config/{normalize-sync-imports-options.d.ts → normalize/sync-imports-options.d.ts} +2 -2
- package/dist/config/normalize/sync-imports-options.d.ts.map +1 -0
- package/dist/config/{normalize-sync-imports-options.js → normalize/sync-imports-options.js} +5 -5
- package/dist/config/normalize/sync-imports-options.js.map +1 -0
- package/dist/imports/check-sync-imports.js +1 -1
- package/dist/imports/check-sync-imports.js.map +1 -1
- package/dist/imports/scan.d.ts.map +1 -1
- package/dist/imports/scan.js +127 -26
- package/dist/imports/scan.js.map +1 -1
- package/dist/imports/sync-imports.d.ts.map +1 -1
- package/dist/imports/sync-imports.js +59 -47
- package/dist/imports/sync-imports.js.map +1 -1
- package/dist/imports/types.d.ts +26 -1
- package/dist/imports/types.d.ts.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/native/native.d.ts +18 -0
- package/dist/native/native.d.ts.map +1 -0
- package/dist/native/native.js +78 -0
- package/dist/native/native.js.map +1 -0
- package/dist/run.d.ts +2 -0
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +4 -0
- package/dist/run.js.map +1 -1
- package/dist/runtime/{runtime-imports-sync.d.ts → imports-sync.d.ts} +1 -1
- package/dist/runtime/imports-sync.d.ts.map +1 -0
- package/dist/runtime/{runtime-imports-sync.js → imports-sync.js} +33 -21
- package/dist/runtime/imports-sync.js.map +1 -0
- package/dist/shared/discipline-types.d.ts +1 -1
- package/dist/shared/discipline-types.d.ts.map +1 -1
- package/dist/shared/logging.d.ts.map +1 -1
- package/dist/shared/logging.js +28 -13
- package/dist/shared/logging.js.map +1 -1
- package/dist/shared/utils.d.ts +4 -4
- package/dist/shared/utils.d.ts.map +1 -1
- package/dist/shared/utils.js +4 -4
- package/dist/shared/utils.js.map +1 -1
- package/native/darwin-arm64.node +0 -0
- package/native/darwin-x64.node +0 -0
- package/native/linux-arm64-gnu.node +0 -0
- package/native/linux-x64-gnu.node +0 -0
- package/package.json +11 -4
- package/dist/checks/rules/comment-stripping.d.ts.map +0 -1
- package/dist/checks/rules/comment-stripping.js.map +0 -1
- package/dist/checks/rules/dry.d.ts +0 -7
- package/dist/checks/rules/dry.d.ts.map +0 -1
- package/dist/checks/rules/dry.js +0 -905
- package/dist/checks/rules/dry.js.map +0 -1
- package/dist/checks/rules/folderize-compound-files.d.ts +0 -6
- package/dist/checks/rules/folderize-compound-files.d.ts.map +0 -1
- package/dist/checks/rules/folderize-compound-files.js.map +0 -1
- package/dist/checks/rules/folderize-plan.d.ts.map +0 -1
- package/dist/checks/rules/folderize-plan.js.map +0 -1
- package/dist/checks/rules/max-file-lines.d.ts +0 -6
- package/dist/checks/rules/max-file-lines.d.ts.map +0 -1
- package/dist/checks/rules/max-file-lines.js.map +0 -1
- package/dist/checks/rules/max-function-lines.d.ts +0 -6
- package/dist/checks/rules/max-function-lines.d.ts.map +0 -1
- package/dist/checks/rules/max-function-lines.js.map +0 -1
- package/dist/config/normalize-check-options.d.ts.map +0 -1
- package/dist/config/normalize-check-options.js.map +0 -1
- package/dist/config/normalize-rule-options.d.ts.map +0 -1
- package/dist/config/normalize-rule-options.js.map +0 -1
- package/dist/config/normalize-source-options.d.ts.map +0 -1
- package/dist/config/normalize-source-options.js.map +0 -1
- package/dist/config/normalize-sync-imports-options.d.ts.map +0 -1
- package/dist/config/normalize-sync-imports-options.js.map +0 -1
- package/dist/runtime/runtime-imports-sync.d.ts.map +0 -1
- package/dist/runtime/runtime-imports-sync.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@trebired/code-discipline` will be documented here.
|
|
4
4
|
|
|
5
|
+
## 3.1.0
|
|
6
|
+
|
|
7
|
+
- Added explicit CLI scan completion timing so `check` and `gate` report how long the codebase scan took after `Scanning codebase`.
|
|
8
|
+
- Added chunked scan progress logging and native/backend scan summaries so large-repository scans are easier to observe and tune.
|
|
9
|
+
- Reworked source scanning in both the TypeScript fallback and Rust native backend to use chunked concurrent directory traversal for faster large-codebase scans.
|
|
10
|
+
- Added the `TB_CODE_DISCIPLINE_SCAN_CONCURRENCY` override so scan throughput can be tuned per machine or CI worker.
|
|
11
|
+
|
|
12
|
+
## 3.0.0
|
|
13
|
+
|
|
14
|
+
- Added top-level `evasionGuards` checks for packed files, packed lines, packed JavaScript/TypeScript functions, and runtime code hiding through string execution.
|
|
15
|
+
- Added the check-only `evasion-guards` selector so opt-in anti-evasion scans can be targeted from the CLI/runtime.
|
|
16
|
+
- Added a TTY loading animation for long CLI check/fix/gate scans.
|
|
17
|
+
- Changed `remove-comments` fixes to remove comment-only lines during the same per-file rewrite.
|
|
18
|
+
- Added the Rust native backend with TypeScript fallback and native acceleration for source scanning, `max-file-lines`, common `max-function-lines` paths, `folderize-compound-files` checks, `remove-comments`, and `evasion-guards`.
|
|
19
|
+
- Fixed runtime/CLI forwarding for top-level `evasionGuards`.
|
|
20
|
+
- Enforced code-discipline on its own codebase: the package is now a self devDependency, `bun run test` runs through `code-discipline gate`, and the source and test tree were refactored until `check` reports zero violations.
|
|
21
|
+
- Fixed Bun and Node config loading for TypeScript config modules: transpiled modules are now written to `node_modules/.cache/code-discipline` instead of `data:` URLs, so relative `.js` specifiers resolving to `.ts` sources, bare package imports, and import cycles keep a real filesystem base.
|
|
22
|
+
- Fixed native build scripts after folderization and exported the native `stripComments` binding so the Rust backend matches the TypeScript native bridge.
|
|
23
|
+
- Fixed CLI error handling so failures inside `check`, `fix`, and `gate` are reported on stderr with exit code 1 instead of escaping as unhandled rejections.
|
|
24
|
+
|
|
5
25
|
## 2.3.0
|
|
6
26
|
|
|
7
27
|
- Added the package-owned `code-discipline gate -- <command> [args...]` startup wrapper so apps can refuse startup on discipline violations without importing the package into their own source code.
|
package/README.md
CHANGED
|
@@ -8,6 +8,7 @@ Configurable repository discipline checks and rule-driven fixes for Bun and Node
|
|
|
8
8
|
- structural rules such as folderizing compound files
|
|
9
9
|
- sync rules such as keeping source imports, `tsconfig.json`, and optional `package.json#imports` aligned
|
|
10
10
|
- source cleanup rules such as removing comments across supported languages
|
|
11
|
+
- native acceleration with a TypeScript fallback for large codebases
|
|
11
12
|
- DRY enforcement against registered canonical helper functions
|
|
12
13
|
|
|
13
14
|
It is not a formatter, linter replacement, or build system.
|
|
@@ -34,6 +35,19 @@ code-discipline fix sync-imports dry remove-comments
|
|
|
34
35
|
code-discipline gate -- bun run dev
|
|
35
36
|
```
|
|
36
37
|
|
|
38
|
+
## Native Backend
|
|
39
|
+
|
|
40
|
+
`@trebired/code-discipline` can use a Rust native backend when a matching binary is available, with the TypeScript implementation as the fallback. This follows the same native-fast-path shape as `@trebired/logger`: package users keep the same CLI/API, while hot scanning and rewrite paths can move into Rust.
|
|
41
|
+
|
|
42
|
+
The current native backend accelerates source scanning, `max-file-lines`, common `max-function-lines` paths, `folderize-compound-files` checks, `remove-comments`, and `evasion-guards`. If no binary is present, the package automatically uses the TypeScript fallback.
|
|
43
|
+
|
|
44
|
+
Useful native controls:
|
|
45
|
+
|
|
46
|
+
- `bun run build:native` builds the host native addon into `native/<platform>.node`
|
|
47
|
+
- `bun run build:native:matrix` builds the release target matrix
|
|
48
|
+
- `TB_CODE_DISCIPLINE_DISABLE_NATIVE=1` forces the TypeScript fallback
|
|
49
|
+
- `TB_CODE_DISCIPLINE_NATIVE_BINARY=/path/to/addon.node` loads a specific native addon
|
|
50
|
+
|
|
37
51
|
Top-level `sync` is gone.
|
|
38
52
|
|
|
39
53
|
`sync-imports` is now just another fixable rule, so targeted sync work is done through:
|
|
@@ -88,6 +102,8 @@ Legacy config filenames are no longer auto-discovered, but they still work when
|
|
|
88
102
|
|
|
89
103
|
Rules are enabled by presence. If a rule object exists under `rules`, it runs.
|
|
90
104
|
|
|
105
|
+
`evasionGuards` is a top-level opt-in system because it checks suspicious compliance patterns across rules instead of being a normal style rule.
|
|
106
|
+
|
|
91
107
|
Example `tb.code-discipline.ts`:
|
|
92
108
|
|
|
93
109
|
```ts
|
|
@@ -104,6 +120,7 @@ export default defineCodeDisciplineConfig({
|
|
|
104
120
|
normalize: "relative-dot-prefix",
|
|
105
121
|
restoreAfterRun: true,
|
|
106
122
|
},
|
|
123
|
+
evasionGuards: true,
|
|
107
124
|
lifecycle: {
|
|
108
125
|
async beforeRun(context) {
|
|
109
126
|
context.state.started = true;
|
|
@@ -193,8 +210,9 @@ Rules use kebab-case public slugs:
|
|
|
193
210
|
- `sync-imports`
|
|
194
211
|
- `remove-comments`
|
|
195
212
|
- `dry`
|
|
213
|
+
- `evasion-guards`
|
|
196
214
|
|
|
197
|
-
`fix` only accepts fixable rules. Trying to run `code-discipline fix max-function-lines` fails clearly.
|
|
215
|
+
`fix` only accepts fixable rules. Trying to run `code-discipline fix max-function-lines` or `code-discipline fix evasion-guards` fails clearly.
|
|
198
216
|
|
|
199
217
|
## Runtime API
|
|
200
218
|
|
|
@@ -257,6 +275,35 @@ Reports files whose total line count exceeds `max`.
|
|
|
257
275
|
|
|
258
276
|
Reports function-like declarations whose total span exceeds `max`.
|
|
259
277
|
|
|
278
|
+
### `evasionGuards`
|
|
279
|
+
|
|
280
|
+
Reports suspicious attempts to satisfy discipline rules without actually improving the code. This is mainly for AI agents because they commonly produce this type of shady slop: compressing long files or large functions into one-line/few-line code so max-line checks stop complaining.
|
|
281
|
+
|
|
282
|
+
Enable it at the top level:
|
|
283
|
+
|
|
284
|
+
```ts
|
|
285
|
+
export default defineCodeDisciplineConfig({
|
|
286
|
+
evasionGuards: true,
|
|
287
|
+
rules: {
|
|
288
|
+
maxFileLines: {
|
|
289
|
+
max: 500,
|
|
290
|
+
},
|
|
291
|
+
maxFunctionLines: {
|
|
292
|
+
max: 80,
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
});
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
It detects:
|
|
299
|
+
|
|
300
|
+
- packed files with very few physical lines but lots of code structure
|
|
301
|
+
- packed lines with excessive statement or structural density
|
|
302
|
+
- packed JavaScript/TypeScript functions that dodge line-count limits
|
|
303
|
+
- runtime code hiding through string execution such as `eval`, `new Function`, or `setTimeout("code")`
|
|
304
|
+
|
|
305
|
+
`evasionGuards` is check-only and disabled unless explicitly configured.
|
|
306
|
+
|
|
260
307
|
### `folderizeCompoundFiles`
|
|
261
308
|
|
|
262
309
|
Detects flat compound names such as `user_route.ts` and can move them into structural folders such as `user/route.ts`.
|
|
@@ -302,7 +349,7 @@ The rule supports the same language families this package currently scans for di
|
|
|
302
349
|
- Go
|
|
303
350
|
- Rust
|
|
304
351
|
|
|
305
|
-
It keeps string, regex, rune, char, byte-string, and raw-string content intact while removing actual source comments.
|
|
352
|
+
It keeps string, regex, rune, char, byte-string, and raw-string content intact while removing actual source comments. When a removed comment occupied the whole line, that empty line is removed in the same file rewrite.
|
|
306
353
|
|
|
307
354
|
Example targeted CLI usage:
|
|
308
355
|
|
|
@@ -5,7 +5,7 @@ import { isRelativeImportSpecifier } from "../imports/resolve.js";
|
|
|
5
5
|
import { supportsFolderizationFix } from "../shared/languages.js";
|
|
6
6
|
import { FileConflictError, FixFailureError, RewriteFailureError } from "../shared/errors.js";
|
|
7
7
|
import { ensureDotExtension, pathExists, stripKnownExtension, toPosixPath } from "../shared/utils.js";
|
|
8
|
-
import { planFolderizeCompoundFiles } from "./rules/folderize
|
|
8
|
+
import { planFolderizeCompoundFiles } from "./rules/folderize/plan.js";
|
|
9
9
|
function createFolderizationViolation(filePath, suggestedPath, options, details) {
|
|
10
10
|
return {
|
|
11
11
|
rule: "folderize-compound-files",
|
package/dist/checks/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ declare function buildNormalizedSyncOptions(options: NormalizedCheckCodeDiscipli
|
|
|
8
8
|
excludeDirs: string[];
|
|
9
9
|
excludeGitignoreDirs: boolean;
|
|
10
10
|
gitignorePath: string;
|
|
11
|
+
scanObserver: import("../imports/types.js").SourceScanObserver;
|
|
11
12
|
tsconfigPath: string;
|
|
12
13
|
fix: boolean;
|
|
13
14
|
alias: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/checks/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/checks/index.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EACV,0BAA0B,EAC1B,yBAAyB,EACzB,oCAAoC,EACpC,wBAAwB,EACxB,uBAAuB,EAGvB,oCAAoC,EACrC,MAAM,YAAY,CAAC;AAYpB,iBAAe,0BAA0B,CACvC,OAAO,EAAE,oCAAoC,EAC7C,GAAG,EAAE,OAAO,EACZ,IAAI,GAAE,oCAAoC,GAAG,SAAqC;;;;;;;;;;;;;;;;;;;;GAgDnF;AAmLD,iBAAe,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAQ1G;AAED,iBAAe,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAqBpG;AAED,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,CAAC"}
|
package/dist/checks/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { normalizeCheckCodeDisciplineOptions } from "../config/normalize
|
|
2
|
+
import { normalizeCheckCodeDisciplineOptions } from "../config/normalize/check-options.js";
|
|
3
3
|
import { collectSyncImportViolations } from "../imports/check-sync-imports.js";
|
|
4
4
|
import { scanSourceFiles } from "../imports/scan.js";
|
|
5
5
|
import { syncImports } from "../imports/sync-imports.js";
|
|
@@ -9,10 +9,11 @@ import { resolveLogger } from "../shared/logging.js";
|
|
|
9
9
|
import { ensureDotExtension, normalizeRelativePath, uniqueStrings } from "../shared/utils.js";
|
|
10
10
|
import { shouldRunRule } from "./rule-slugs.js";
|
|
11
11
|
import { fixFolderization } from "./fix-folderization.js";
|
|
12
|
-
import { runFolderizeCompoundFilesRule } from "./rules/folderize
|
|
13
|
-
import { collectDryViolations, fixDryRule } from "./rules/dry.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
12
|
+
import { runFolderizeCompoundFilesRule } from "./rules/folderize/compound-files.js";
|
|
13
|
+
import { collectDryViolations, fixDryRule } from "./rules/dry/index.js";
|
|
14
|
+
import { runEvasionGuardsRule } from "./rules/evasion-guards/index.js";
|
|
15
|
+
import { runMaxFileLinesRule } from "./rules/max/file-lines.js";
|
|
16
|
+
import { runMaxFunctionLinesRule } from "./rules/max/function-lines.js";
|
|
16
17
|
import { collectRemoveCommentsViolations, fixRemoveCommentsRule } from "./rules/remove-comments.js";
|
|
17
18
|
async function buildNormalizedSyncOptions(options, fix, rule = options.rules.syncImports) {
|
|
18
19
|
if (!rule)
|
|
@@ -48,6 +49,7 @@ async function buildNormalizedSyncOptions(options, fix, rule = options.rules.syn
|
|
|
48
49
|
excludeDirs,
|
|
49
50
|
excludeGitignoreDirs: rule.excludeDirs?.gitignore ?? options.excludeGitignoreDirs,
|
|
50
51
|
gitignorePath,
|
|
52
|
+
scanObserver: options.scanObserver,
|
|
51
53
|
tsconfigPath: rule.tsconfigPath ?? `${options.projectRoot}/tsconfig.json`,
|
|
52
54
|
fix,
|
|
53
55
|
alias: {
|
|
@@ -105,6 +107,9 @@ async function collectViolations(options) {
|
|
|
105
107
|
if (options.rules.removeComments && shouldRunRule("remove-comments", options.onlyRules)) {
|
|
106
108
|
violations.push(...await collectRemoveCommentsViolations(sourceFiles));
|
|
107
109
|
}
|
|
110
|
+
if (options.evasionGuards && shouldRunRule("evasion-guards", options.onlyRules)) {
|
|
111
|
+
violations.push(...await runEvasionGuardsRule(sourceFiles, options));
|
|
112
|
+
}
|
|
108
113
|
return sortViolations(violations);
|
|
109
114
|
}
|
|
110
115
|
function mapFixRuleResult(result) {
|
|
@@ -123,6 +128,75 @@ function mapFixRuleResult(result) {
|
|
|
123
128
|
function shouldRunFixRule(rule, options) {
|
|
124
129
|
return shouldRunRule(rule, options.onlyRules);
|
|
125
130
|
}
|
|
131
|
+
async function applyFolderizeFix(state, normalized, logger) {
|
|
132
|
+
if (!normalized.rules.folderizeCompoundFiles || !shouldRunFixRule("folderize-compound-files", normalized))
|
|
133
|
+
return;
|
|
134
|
+
const result = await fixFolderization(state.sourceFiles, normalized, logger);
|
|
135
|
+
state.ruleResults["folderize-compound-files"] = mapFixRuleResult(result);
|
|
136
|
+
state.violations.push(...result.violations);
|
|
137
|
+
state.movedFiles += result.moved_files;
|
|
138
|
+
state.rewrittenFiles += result.rewritten_files;
|
|
139
|
+
state.rewrittenImports += result.rewritten_imports;
|
|
140
|
+
if (result.moved_files > 0 || result.rewritten_files > 0) {
|
|
141
|
+
state.sourceFiles = await scanSourceFiles(normalized);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
async function applyDryFix(state, normalized) {
|
|
145
|
+
if (!normalized.rules.dry || !shouldRunFixRule("dry", normalized))
|
|
146
|
+
return;
|
|
147
|
+
const result = await fixDryRule(state.sourceFiles, normalized);
|
|
148
|
+
state.ruleResults.dry = mapFixRuleResult(result);
|
|
149
|
+
state.violations.push(...result.violations);
|
|
150
|
+
state.rewrittenFiles += result.rewritten_files ?? 0;
|
|
151
|
+
if ((result.rewritten_files ?? 0) > 0) {
|
|
152
|
+
state.sourceFiles = await scanSourceFiles(normalized);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
async function applySyncImportsFix(state, normalized) {
|
|
156
|
+
if (!normalized.rules.syncImports || !shouldRunFixRule("sync-imports", normalized))
|
|
157
|
+
return;
|
|
158
|
+
const syncOptions = await buildNormalizedSyncOptions(normalized, true);
|
|
159
|
+
if (!syncOptions)
|
|
160
|
+
return;
|
|
161
|
+
const result = await syncImports(syncOptions);
|
|
162
|
+
state.ruleResults["sync-imports"] = mapFixRuleResult(result);
|
|
163
|
+
state.violations.push(...result.violations);
|
|
164
|
+
state.rewrittenFiles += result.rewritten_files;
|
|
165
|
+
state.rewrittenImports += result.rewritten_imports;
|
|
166
|
+
}
|
|
167
|
+
async function applyRemoveCommentsFix(state, normalized) {
|
|
168
|
+
if (!normalized.rules.removeComments || !shouldRunFixRule("remove-comments", normalized))
|
|
169
|
+
return;
|
|
170
|
+
const result = await fixRemoveCommentsRule(state.sourceFiles, normalized);
|
|
171
|
+
state.ruleResults["remove-comments"] = mapFixRuleResult(result);
|
|
172
|
+
state.violations.push(...result.violations);
|
|
173
|
+
state.rewrittenFiles += result.rewritten_files ?? 0;
|
|
174
|
+
state.removedComments += result.removed_comments ?? 0;
|
|
175
|
+
}
|
|
176
|
+
function createFixResult(state) {
|
|
177
|
+
return {
|
|
178
|
+
...summarizeViolations(sortViolations(state.violations)),
|
|
179
|
+
moved_files: state.movedFiles,
|
|
180
|
+
rewritten_files: state.rewrittenFiles,
|
|
181
|
+
rewritten_imports: state.rewrittenImports,
|
|
182
|
+
removed_comments: state.removedComments,
|
|
183
|
+
ruleResults: state.ruleResults,
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
function logFixResult(result, logger) {
|
|
187
|
+
if (!result.ok || result.violations.length > 0) {
|
|
188
|
+
logSummary("fix", result, logger);
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
logger.flush("success", "discipline-fix-ok", "fix completed", {
|
|
192
|
+
violationCount: result.violationCount,
|
|
193
|
+
movedFiles: result.moved_files,
|
|
194
|
+
rewrittenFiles: result.rewritten_files,
|
|
195
|
+
rewrittenImports: result.rewritten_imports,
|
|
196
|
+
removedComments: result.removed_comments,
|
|
197
|
+
ruleResults: result.ruleResults,
|
|
198
|
+
});
|
|
199
|
+
}
|
|
126
200
|
async function checkCodeDiscipline(options) {
|
|
127
201
|
const normalized = await normalizeCheckCodeDisciplineOptions(options, "check");
|
|
128
202
|
const logger = resolveLogger(normalized.logging);
|
|
@@ -134,72 +208,21 @@ async function checkCodeDiscipline(options) {
|
|
|
134
208
|
async function fixCodeDiscipline(options) {
|
|
135
209
|
const normalized = await normalizeCheckCodeDisciplineOptions(options, "fix");
|
|
136
210
|
const logger = resolveLogger(normalized.logging);
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
const folderizeResult = await fixFolderization(sourceFiles, normalized, logger);
|
|
146
|
-
ruleResults["folderize-compound-files"] = mapFixRuleResult(folderizeResult);
|
|
147
|
-
violations.push(...folderizeResult.violations);
|
|
148
|
-
movedFiles += folderizeResult.moved_files;
|
|
149
|
-
rewrittenFiles += folderizeResult.rewritten_files;
|
|
150
|
-
rewrittenImports += folderizeResult.rewritten_imports;
|
|
151
|
-
if (folderizeResult.moved_files > 0 || folderizeResult.rewritten_files > 0) {
|
|
152
|
-
sourceFiles = await scanSourceFiles(normalized);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
if (normalized.rules.dry && shouldRunFixRule("dry", normalized)) {
|
|
156
|
-
const dryResult = await fixDryRule(sourceFiles, normalized);
|
|
157
|
-
ruleResults.dry = mapFixRuleResult(dryResult);
|
|
158
|
-
violations.push(...dryResult.violations);
|
|
159
|
-
rewrittenFiles += dryResult.rewritten_files ?? 0;
|
|
160
|
-
if ((dryResult.rewritten_files ?? 0) > 0) {
|
|
161
|
-
sourceFiles = await scanSourceFiles(normalized);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
if (normalized.rules.syncImports && shouldRunFixRule("sync-imports", normalized)) {
|
|
165
|
-
const syncOptions = await buildNormalizedSyncOptions(normalized, true);
|
|
166
|
-
if (syncOptions) {
|
|
167
|
-
const syncResult = await syncImports(syncOptions);
|
|
168
|
-
ruleResults["sync-imports"] = mapFixRuleResult(syncResult);
|
|
169
|
-
violations.push(...syncResult.violations);
|
|
170
|
-
rewrittenFiles += syncResult.rewritten_files;
|
|
171
|
-
rewrittenImports += syncResult.rewritten_imports;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
if (normalized.rules.removeComments && shouldRunFixRule("remove-comments", normalized)) {
|
|
175
|
-
const removeCommentsResult = await fixRemoveCommentsRule(sourceFiles, normalized);
|
|
176
|
-
ruleResults["remove-comments"] = mapFixRuleResult(removeCommentsResult);
|
|
177
|
-
violations.push(...removeCommentsResult.violations);
|
|
178
|
-
rewrittenFiles += removeCommentsResult.rewritten_files ?? 0;
|
|
179
|
-
removedComments += removeCommentsResult.removed_comments ?? 0;
|
|
180
|
-
}
|
|
181
|
-
const summary = summarizeViolations(sortViolations(violations));
|
|
182
|
-
const result = {
|
|
183
|
-
...summary,
|
|
184
|
-
moved_files: movedFiles,
|
|
185
|
-
rewritten_files: rewrittenFiles,
|
|
186
|
-
rewritten_imports: rewrittenImports,
|
|
187
|
-
removed_comments: removedComments,
|
|
188
|
-
ruleResults,
|
|
211
|
+
const state = {
|
|
212
|
+
movedFiles: 0,
|
|
213
|
+
removedComments: 0,
|
|
214
|
+
rewrittenFiles: 0,
|
|
215
|
+
rewrittenImports: 0,
|
|
216
|
+
ruleResults: {},
|
|
217
|
+
sourceFiles: await scanSourceFiles(normalized),
|
|
218
|
+
violations: [],
|
|
189
219
|
};
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
movedFiles: result.moved_files,
|
|
197
|
-
rewrittenFiles: result.rewritten_files,
|
|
198
|
-
rewrittenImports: result.rewritten_imports,
|
|
199
|
-
removedComments: result.removed_comments,
|
|
200
|
-
ruleResults: result.ruleResults,
|
|
201
|
-
});
|
|
202
|
-
}
|
|
220
|
+
await applyFolderizeFix(state, normalized, logger);
|
|
221
|
+
await applyDryFix(state, normalized);
|
|
222
|
+
await applySyncImportsFix(state, normalized);
|
|
223
|
+
await applyRemoveCommentsFix(state, normalized);
|
|
224
|
+
const result = createFixResult(state);
|
|
225
|
+
logFixResult(result, logger);
|
|
203
226
|
return result;
|
|
204
227
|
}
|
|
205
228
|
export { buildNormalizedSyncOptions, checkCodeDiscipline, fixCodeDiscipline };
|
package/dist/checks/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/checks/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,mCAAmC,EAAE,MAAM,sCAAsC,CAAC;AAC3F,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/checks/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,mCAAmC,EAAE,MAAM,sCAAsC,CAAC;AAC3F,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAE/E,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC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,CAAC;IACpC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,KAAK,UAAU,iBAAiB,CAAC,OAAiC;IAChE,MAAM,UAAU,GAAG,MAAM,mCAAmC,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC7E,MAAM,MAAM,GAAG,aAAa,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACjD,MAAM,KAAK,GAAa;QACtB,UAAU,EAAE,CAAC;QACb,eAAe,EAAE,CAAC;QAClB,cAAc,EAAE,CAAC;QACjB,gBAAgB,EAAE,CAAC;QACnB,WAAW,EAAE,EAAE;QACf,WAAW,EAAE,MAAM,eAAe,CAAC,UAAU,CAAC;QAC9C,UAAU,EAAE,EAAE;KACf,CAAC;IAEF,MAAM,iBAAiB,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IACnD,MAAM,WAAW,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IACrC,MAAM,mBAAmB,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IAC7C,MAAM,sBAAsB,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IAEhD,MAAM,MAAM,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IACtC,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CodeDisciplineMode, CodeDisciplineRuleSlug, CodeDisciplineRules, FixableRuleSlug } from "./types.js";
|
|
1
|
+
import type { CodeDisciplineMode, CodeDisciplineRuleSlug, CodeDisciplineRules, EvasionGuardsOptions, FixableRuleSlug } from "./types.js";
|
|
2
2
|
declare const ALL_RULE_SLUGS: CodeDisciplineRuleSlug[];
|
|
3
3
|
declare const FIXABLE_RULE_SLUGS: FixableRuleSlug[];
|
|
4
4
|
declare const RULE_SLUG_BY_CONFIG_KEY: {
|
|
@@ -9,8 +9,8 @@ declare const RULE_SLUG_BY_CONFIG_KEY: {
|
|
|
9
9
|
readonly removeComments: "remove-comments";
|
|
10
10
|
readonly syncImports: "sync-imports";
|
|
11
11
|
};
|
|
12
|
-
declare function resolveEnabledRuleSlugs(rules: CodeDisciplineRules | undefined): Set<CodeDisciplineRuleSlug>;
|
|
13
|
-
declare function normalizeOnlyRules(mode: CodeDisciplineMode, onlyRules: readonly string[] | undefined, rules: CodeDisciplineRules | undefined): CodeDisciplineRuleSlug[] | FixableRuleSlug[] | undefined;
|
|
12
|
+
declare function resolveEnabledRuleSlugs(rules: CodeDisciplineRules | undefined, evasionGuards?: EvasionGuardsOptions): Set<CodeDisciplineRuleSlug>;
|
|
13
|
+
declare function normalizeOnlyRules(mode: CodeDisciplineMode, onlyRules: readonly string[] | undefined, rules: CodeDisciplineRules | undefined, evasionGuards?: EvasionGuardsOptions): CodeDisciplineRuleSlug[] | FixableRuleSlug[] | undefined;
|
|
14
14
|
declare function shouldRunRule(rule: CodeDisciplineRuleSlug, onlyRules: readonly string[] | undefined): boolean;
|
|
15
15
|
export { ALL_RULE_SLUGS, FIXABLE_RULE_SLUGS, RULE_SLUG_BY_CONFIG_KEY, normalizeOnlyRules, resolveEnabledRuleSlugs, shouldRunRule, };
|
|
16
16
|
//# sourceMappingURL=rule-slugs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rule-slugs.d.ts","sourceRoot":"","sources":["../../src/checks/rule-slugs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAClB,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,EAChB,MAAM,YAAY,CAAC;AAEpB,QAAA,MAAM,cAAc,EAAE,sBAAsB,
|
|
1
|
+
{"version":3,"file":"rule-slugs.d.ts","sourceRoot":"","sources":["../../src/checks/rule-slugs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAClB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EAChB,MAAM,YAAY,CAAC;AAEpB,QAAA,MAAM,cAAc,EAAE,sBAAsB,EAQ3C,CAAC;AAEF,QAAA,MAAM,kBAAkB,EAAE,eAAe,EAKxC,CAAC;AAEF,QAAA,MAAM,uBAAuB;;;;;;;CAOnB,CAAC;AAEX,iBAAS,uBAAuB,CAC9B,KAAK,EAAE,mBAAmB,GAAG,SAAS,EACtC,aAAa,CAAC,EAAE,oBAAoB,GACnC,GAAG,CAAC,sBAAsB,CAAC,CAgB7B;AAED,iBAAS,kBAAkB,CACzB,IAAI,EAAE,kBAAkB,EACxB,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EACxC,KAAK,EAAE,mBAAmB,GAAG,SAAS,EACtC,aAAa,CAAC,EAAE,oBAAoB,GACnC,sBAAsB,EAAE,GAAG,eAAe,EAAE,GAAG,SAAS,CAgC1D;AAED,iBAAS,aAAa,CACpB,IAAI,EAAE,sBAAsB,EAC5B,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GACvC,OAAO,CAET;AAED,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EAClB,uBAAuB,EACvB,aAAa,GACd,CAAC"}
|
|
@@ -6,6 +6,7 @@ const ALL_RULE_SLUGS = [
|
|
|
6
6
|
"sync-imports",
|
|
7
7
|
"remove-comments",
|
|
8
8
|
"dry",
|
|
9
|
+
"evasion-guards",
|
|
9
10
|
];
|
|
10
11
|
const FIXABLE_RULE_SLUGS = [
|
|
11
12
|
"folderize-compound-files",
|
|
@@ -21,22 +22,25 @@ const RULE_SLUG_BY_CONFIG_KEY = {
|
|
|
21
22
|
removeComments: "remove-comments",
|
|
22
23
|
syncImports: "sync-imports",
|
|
23
24
|
};
|
|
24
|
-
function resolveEnabledRuleSlugs(rules) {
|
|
25
|
+
function resolveEnabledRuleSlugs(rules, evasionGuards) {
|
|
25
26
|
const enabled = new Set();
|
|
26
|
-
if (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
if (rules) {
|
|
28
|
+
for (const [key, slug] of Object.entries(RULE_SLUG_BY_CONFIG_KEY)) {
|
|
29
|
+
if (rules[key]) {
|
|
30
|
+
enabled.add(slug);
|
|
31
|
+
}
|
|
31
32
|
}
|
|
32
33
|
}
|
|
34
|
+
if (evasionGuards) {
|
|
35
|
+
enabled.add("evasion-guards");
|
|
36
|
+
}
|
|
33
37
|
return enabled;
|
|
34
38
|
}
|
|
35
|
-
function normalizeOnlyRules(mode, onlyRules, rules) {
|
|
39
|
+
function normalizeOnlyRules(mode, onlyRules, rules, evasionGuards) {
|
|
36
40
|
if (!onlyRules || onlyRules.length === 0)
|
|
37
41
|
return undefined;
|
|
38
42
|
const allowedRules = new Set(mode === "fix" ? FIXABLE_RULE_SLUGS : ALL_RULE_SLUGS);
|
|
39
|
-
const enabledRules = resolveEnabledRuleSlugs(rules);
|
|
43
|
+
const enabledRules = resolveEnabledRuleSlugs(rules, evasionGuards);
|
|
40
44
|
const normalized = [];
|
|
41
45
|
for (const rule of onlyRules) {
|
|
42
46
|
if (!allowedRules.has(rule)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rule-slugs.js","sourceRoot":"","sources":["../../src/checks/rule-slugs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"rule-slugs.js","sourceRoot":"","sources":["../../src/checks/rule-slugs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AASvE,MAAM,cAAc,GAA6B;IAC/C,gBAAgB;IAChB,oBAAoB;IACpB,0BAA0B;IAC1B,cAAc;IACd,iBAAiB;IACjB,KAAK;IACL,gBAAgB;CACjB,CAAC;AAEF,MAAM,kBAAkB,GAAsB;IAC5C,0BAA0B;IAC1B,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AAC;YAC5B,MAAM,IAAI,gCAAgC,CACxC,IAAI,KAAK,KAAK;gBACZ,CAAC,CAAC,iCAAiC,IAAI,EAAE;gBACzC,CAAC,CAAC,0BAA0B,IAAI,EAAE,EACpC,EAAE,IAAI,EAAE,IAAI,EAAE,CACf,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAA8B,CAAC,EAAE,CAAC;YACtD,MAAM,IAAI,gCAAgC,CAAC,oCAAoC,IAAI,EAAE,EAAE;gBACrF,IAAI;gBACJ,IAAI;aACL,CAAC,CAAC;QACL,CAAC;QAED,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAA8B,CAAC,EAAE,CAAC;YACzD,UAAU,CAAC,IAAI,CAAC,IAA8B,CAAC,CAAC;QAClD,CAAC;IACH,CAAC;IAED,OAAO,IAAI,KAAK,KAAK;QACnB,CAAC,CAAC,UAA+B;QACjC,CAAC,CAAC,UAAU,CAAC;AACjB,CAAC;AAED,SAAS,aAAa,CACpB,IAA4B,EAC5B,SAAwC;IAExC,OAAO,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC1E,CAAC;AAED,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EAClB,uBAAuB,EACvB,aAAa,GACd,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type CommentKind = "line" | "block";
|
|
2
|
+
type CommentRange = {
|
|
3
|
+
start: number;
|
|
4
|
+
end: number;
|
|
5
|
+
kind: CommentKind;
|
|
6
|
+
};
|
|
7
|
+
declare function collectCommentRanges(text: string, extension: string): CommentRange[];
|
|
8
|
+
export { collectCommentRanges };
|
|
9
|
+
export type { CommentRange };
|
|
10
|
+
//# sourceMappingURL=ranges.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ranges.d.ts","sourceRoot":"","sources":["../../../../src/checks/rules/comments/ranges.ts"],"names":[],"mappings":"AAIA,KAAK,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC;AAEpC,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,WAAW,CAAC;CACnB,CAAC;AA4OF,iBAAS,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,YAAY,EAAE,CAK7E;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAChC,YAAY,EAAE,YAAY,EAAE,CAAC"}
|