@mmnto/totem 0.18.0 → 0.20.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/LICENSE +190 -21
- package/dist/compiler.d.ts +18 -1
- package/dist/compiler.d.ts.map +1 -1
- package/dist/compiler.js +81 -5
- package/dist/compiler.js.map +1 -1
- package/dist/compiler.test.js +252 -2
- package/dist/compiler.test.js.map +1 -1
- package/dist/config-schema.d.ts +188 -30
- package/dist/config-schema.d.ts.map +1 -1
- package/dist/config-schema.js +41 -10
- package/dist/config-schema.js.map +1 -1
- package/dist/config-schema.test.js +131 -1
- package/dist/config-schema.test.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/LICENSE
CHANGED
|
@@ -1,21 +1,190 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by the Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding any notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
Copyright 2025-2026 Matt Sutton / Memento AI (mmnto-ai)
|
|
179
|
+
|
|
180
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
+
you may not use this file except in compliance with the License.
|
|
182
|
+
You may obtain a copy of the License at
|
|
183
|
+
|
|
184
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
+
|
|
186
|
+
Unless required by applicable law or agreed to in writing, software
|
|
187
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
+
See the License for the specific language governing permissions and
|
|
190
|
+
limitations under the License.
|
package/dist/compiler.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export declare const CompiledRuleSchema: z.ZodObject<{
|
|
|
12
12
|
engine: z.ZodLiteral<"regex">;
|
|
13
13
|
/** ISO timestamp of when this rule was compiled */
|
|
14
14
|
compiledAt: z.ZodString;
|
|
15
|
+
/** Optional file glob patterns — rule only applies to matching files (e.g., ["*.sh", "*.yml"]) */
|
|
16
|
+
fileGlobs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
15
17
|
}, "strip", z.ZodTypeAny, {
|
|
16
18
|
lessonHash: string;
|
|
17
19
|
lessonHeading: string;
|
|
@@ -19,6 +21,7 @@ export declare const CompiledRuleSchema: z.ZodObject<{
|
|
|
19
21
|
message: string;
|
|
20
22
|
engine: "regex";
|
|
21
23
|
compiledAt: string;
|
|
24
|
+
fileGlobs?: string[] | undefined;
|
|
22
25
|
}, {
|
|
23
26
|
lessonHash: string;
|
|
24
27
|
lessonHeading: string;
|
|
@@ -26,6 +29,7 @@ export declare const CompiledRuleSchema: z.ZodObject<{
|
|
|
26
29
|
message: string;
|
|
27
30
|
engine: "regex";
|
|
28
31
|
compiledAt: string;
|
|
32
|
+
fileGlobs?: string[] | undefined;
|
|
29
33
|
}>;
|
|
30
34
|
export type CompiledRule = z.infer<typeof CompiledRuleSchema>;
|
|
31
35
|
export declare const CompiledRulesFileSchema: z.ZodObject<{
|
|
@@ -43,6 +47,8 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
|
|
|
43
47
|
engine: z.ZodLiteral<"regex">;
|
|
44
48
|
/** ISO timestamp of when this rule was compiled */
|
|
45
49
|
compiledAt: z.ZodString;
|
|
50
|
+
/** Optional file glob patterns — rule only applies to matching files (e.g., ["*.sh", "*.yml"]) */
|
|
51
|
+
fileGlobs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
46
52
|
}, "strip", z.ZodTypeAny, {
|
|
47
53
|
lessonHash: string;
|
|
48
54
|
lessonHeading: string;
|
|
@@ -50,6 +56,7 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
|
|
|
50
56
|
message: string;
|
|
51
57
|
engine: "regex";
|
|
52
58
|
compiledAt: string;
|
|
59
|
+
fileGlobs?: string[] | undefined;
|
|
53
60
|
}, {
|
|
54
61
|
lessonHash: string;
|
|
55
62
|
lessonHeading: string;
|
|
@@ -57,6 +64,7 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
|
|
|
57
64
|
message: string;
|
|
58
65
|
engine: "regex";
|
|
59
66
|
compiledAt: string;
|
|
67
|
+
fileGlobs?: string[] | undefined;
|
|
60
68
|
}>, "many">;
|
|
61
69
|
}, "strip", z.ZodTypeAny, {
|
|
62
70
|
version: 1;
|
|
@@ -67,6 +75,7 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
|
|
|
67
75
|
message: string;
|
|
68
76
|
engine: "regex";
|
|
69
77
|
compiledAt: string;
|
|
78
|
+
fileGlobs?: string[] | undefined;
|
|
70
79
|
}[];
|
|
71
80
|
}, {
|
|
72
81
|
version: 1;
|
|
@@ -77,6 +86,7 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
|
|
|
77
86
|
message: string;
|
|
78
87
|
engine: "regex";
|
|
79
88
|
compiledAt: string;
|
|
89
|
+
fileGlobs?: string[] | undefined;
|
|
80
90
|
}[];
|
|
81
91
|
}>;
|
|
82
92
|
export type CompiledRulesFile = z.infer<typeof CompiledRulesFileSchema>;
|
|
@@ -105,17 +115,21 @@ interface DiffAddition {
|
|
|
105
115
|
file: string;
|
|
106
116
|
line: string;
|
|
107
117
|
lineNumber: number;
|
|
118
|
+
/** Content of the preceding line in the new file (context or added), null if first in hunk */
|
|
119
|
+
precedingLine: string | null;
|
|
108
120
|
}
|
|
109
121
|
/**
|
|
110
122
|
* Extract added lines from a unified diff.
|
|
111
123
|
* Returns only lines that start with `+` (excluding `+++` file headers).
|
|
124
|
+
* Tracks the preceding line content (context or added) for suppression support.
|
|
112
125
|
*/
|
|
113
126
|
export declare function extractAddedLines(diff: string): DiffAddition[];
|
|
114
127
|
/**
|
|
115
128
|
* Apply compiled rules against added lines from a diff.
|
|
116
129
|
* Returns all violations found.
|
|
130
|
+
* @param excludeFiles — file paths to skip (e.g., compiled-rules.json to avoid self-matches)
|
|
117
131
|
*/
|
|
118
|
-
export declare function applyRules(rules: CompiledRule[], diff: string): Violation[];
|
|
132
|
+
export declare function applyRules(rules: CompiledRule[], diff: string, excludeFiles?: string[]): Violation[];
|
|
119
133
|
/** Load compiled rules from a JSON file. Returns empty array if file missing or invalid. */
|
|
120
134
|
export declare function loadCompiledRules(rulesPath: string): CompiledRule[];
|
|
121
135
|
/** Save compiled rules to a JSON file. */
|
|
@@ -125,14 +139,17 @@ export declare const CompilerOutputSchema: z.ZodObject<{
|
|
|
125
139
|
compilable: z.ZodBoolean;
|
|
126
140
|
pattern: z.ZodOptional<z.ZodString>;
|
|
127
141
|
message: z.ZodOptional<z.ZodString>;
|
|
142
|
+
fileGlobs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
128
143
|
}, "strip", z.ZodTypeAny, {
|
|
129
144
|
compilable: boolean;
|
|
130
145
|
pattern?: string | undefined;
|
|
131
146
|
message?: string | undefined;
|
|
147
|
+
fileGlobs?: string[] | undefined;
|
|
132
148
|
}, {
|
|
133
149
|
compilable: boolean;
|
|
134
150
|
pattern?: string | undefined;
|
|
135
151
|
message?: string | undefined;
|
|
152
|
+
fileGlobs?: string[] | undefined;
|
|
136
153
|
}>;
|
|
137
154
|
export type CompilerOutput = z.infer<typeof CompilerOutputSchema>;
|
|
138
155
|
/**
|
package/dist/compiler.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiler.d.ts","sourceRoot":"","sources":["../src/compiler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,kBAAkB;IAC7B,0EAA0E;;IAE1E,+DAA+D;;IAE/D,sDAAsD;;IAEtD,sEAAsE;;IAEtE,yCAAyC;;IAEzC,mDAAmD
|
|
1
|
+
{"version":3,"file":"compiler.d.ts","sourceRoot":"","sources":["../src/compiler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,kBAAkB;IAC7B,0EAA0E;;IAE1E,+DAA+D;;IAE/D,sDAAsD;;IAEtD,sEAAsE;;IAEtE,yCAAyC;;IAEzC,mDAAmD;;IAEnD,kGAAkG;;;;;;;;;;;;;;;;;;EAElG,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,uBAAu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AAE,CAUnE;AAED,0CAA0C;AAC1C,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,IAAI,CAMhF;AAID,8EAA8E;AAC9E,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;EAK/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAa7E"}
|
package/dist/compiler.js
CHANGED
|
@@ -16,6 +16,8 @@ export const CompiledRuleSchema = z.object({
|
|
|
16
16
|
engine: z.literal('regex'),
|
|
17
17
|
/** ISO timestamp of when this rule was compiled */
|
|
18
18
|
compiledAt: z.string(),
|
|
19
|
+
/** Optional file glob patterns — rule only applies to matching files (e.g., ["*.sh", "*.yml"]) */
|
|
20
|
+
fileGlobs: z.array(z.string()).optional(),
|
|
19
21
|
});
|
|
20
22
|
export const CompiledRulesFileSchema = z.object({
|
|
21
23
|
version: z.literal(1),
|
|
@@ -50,11 +52,13 @@ export function validateRegex(pattern) {
|
|
|
50
52
|
/**
|
|
51
53
|
* Extract added lines from a unified diff.
|
|
52
54
|
* Returns only lines that start with `+` (excluding `+++` file headers).
|
|
55
|
+
* Tracks the preceding line content (context or added) for suppression support.
|
|
53
56
|
*/
|
|
54
57
|
export function extractAddedLines(diff) {
|
|
55
58
|
const additions = [];
|
|
56
59
|
let currentFile = '';
|
|
57
60
|
let lineNum = 0;
|
|
61
|
+
let prevLineContent = null;
|
|
58
62
|
for (const rawLine of diff.split('\n')) {
|
|
59
63
|
// Track current file from diff headers
|
|
60
64
|
// git quotes paths containing spaces: +++ "b/path with spaces/file.ts"
|
|
@@ -66,12 +70,14 @@ export function extractAddedLines(diff) {
|
|
|
66
70
|
}
|
|
67
71
|
// Strip the "b/" prefix git uses for the destination file
|
|
68
72
|
currentFile = pathPart.startsWith('b/') ? pathPart.slice(2) : pathPart;
|
|
73
|
+
prevLineContent = null;
|
|
69
74
|
continue;
|
|
70
75
|
}
|
|
71
76
|
// Parse hunk header for line numbers: @@ -X,Y +Z,W @@
|
|
72
77
|
const hunkMatch = rawLine.match(/^@@ -\d+(?:,\d+)? \+(\d+)/);
|
|
73
78
|
if (hunkMatch) {
|
|
74
79
|
lineNum = parseInt(hunkMatch[1], 10) - 1; // will be incremented on first line
|
|
80
|
+
prevLineContent = null;
|
|
75
81
|
continue;
|
|
76
82
|
}
|
|
77
83
|
// Skip diff metadata lines
|
|
@@ -81,28 +87,89 @@ export function extractAddedLines(diff) {
|
|
|
81
87
|
// Count lines for position tracking
|
|
82
88
|
if (rawLine.startsWith('+')) {
|
|
83
89
|
lineNum++;
|
|
90
|
+
const lineContent = rawLine.slice(1); // strip the leading +
|
|
84
91
|
additions.push({
|
|
85
92
|
file: currentFile,
|
|
86
|
-
line:
|
|
93
|
+
line: lineContent,
|
|
87
94
|
lineNumber: lineNum,
|
|
95
|
+
precedingLine: prevLineContent,
|
|
88
96
|
});
|
|
97
|
+
prevLineContent = lineContent;
|
|
89
98
|
}
|
|
90
|
-
else if (
|
|
91
|
-
//
|
|
99
|
+
else if (rawLine.startsWith('-')) {
|
|
100
|
+
// Deleted line — NOT in new file, don't update prevLineContent or lineNum
|
|
101
|
+
}
|
|
102
|
+
else if (rawLine.startsWith(' ')) {
|
|
103
|
+
// Context line — in new file
|
|
92
104
|
lineNum++;
|
|
105
|
+
prevLineContent = rawLine.slice(1);
|
|
93
106
|
}
|
|
107
|
+
// Ignore other lines (e.g., '')
|
|
94
108
|
}
|
|
95
109
|
return additions;
|
|
96
110
|
}
|
|
97
111
|
// ─── Rule execution ──────────────────────────────────
|
|
112
|
+
// ─── File glob matching ─────────────────────────────
|
|
113
|
+
/**
|
|
114
|
+
* Check if a file path matches a single glob pattern.
|
|
115
|
+
* Supports simple patterns: `*.ext`, `**\/*.ext`, literal filenames.
|
|
116
|
+
*/
|
|
117
|
+
function matchesGlob(filePath, glob) {
|
|
118
|
+
// Normalize separators
|
|
119
|
+
const normalized = filePath.replace(/\\/g, '/');
|
|
120
|
+
// *.ext — match file extension anywhere
|
|
121
|
+
if (glob.startsWith('*.')) {
|
|
122
|
+
return normalized.endsWith(glob.slice(1));
|
|
123
|
+
}
|
|
124
|
+
// **/*.ext — same as *.ext (match extension anywhere in path)
|
|
125
|
+
if (glob.startsWith('**/')) {
|
|
126
|
+
return matchesGlob(normalized, glob.slice(3));
|
|
127
|
+
}
|
|
128
|
+
// Literal filename match (e.g., "Dockerfile")
|
|
129
|
+
return normalized === glob || normalized.endsWith('/' + glob);
|
|
130
|
+
}
|
|
131
|
+
function fileMatchesGlobs(filePath, globs) {
|
|
132
|
+
const positive = globs.filter((g) => !g.startsWith('!'));
|
|
133
|
+
const negative = globs.filter((g) => g.startsWith('!')).map((g) => g.slice(1));
|
|
134
|
+
const positiveMatch = positive.length === 0 || positive.some((g) => matchesGlob(filePath, g));
|
|
135
|
+
const negativeMatch = negative.some((g) => matchesGlob(filePath, g));
|
|
136
|
+
return positiveMatch && !negativeMatch;
|
|
137
|
+
}
|
|
138
|
+
// ─── Rule execution ──────────────────────────────────
|
|
139
|
+
// ─── Inline suppression ─────────────────────────────
|
|
140
|
+
const SUPPRESS_MARKER = 'totem-ignore';
|
|
141
|
+
const SUPPRESS_NEXT_LINE_MARKER = 'totem-ignore-next-line';
|
|
142
|
+
/**
|
|
143
|
+
* Check if a line should be suppressed via inline directives.
|
|
144
|
+
* Supports two forms:
|
|
145
|
+
* - Same-line: code(); // totem-ignore (suppresses all rules on this line)
|
|
146
|
+
* - Next-line: // totem-ignore-next-line on the preceding line (suppresses all rules on this line)
|
|
147
|
+
*
|
|
148
|
+
* Syntax-agnostic: works with any comment style (//, #, HTML comments, block comments).
|
|
149
|
+
*/
|
|
150
|
+
function isSuppressed(line, precedingLine) {
|
|
151
|
+
// Same-line: 'totem-ignore' substring also matches 'totem-ignore-next-line',
|
|
152
|
+
// so directive lines themselves are inherently suppressed.
|
|
153
|
+
if (line.includes(SUPPRESS_MARKER))
|
|
154
|
+
return true;
|
|
155
|
+
// Next-line: preceding line (context or added) contains the next-line directive
|
|
156
|
+
if (precedingLine != null && precedingLine.includes(SUPPRESS_NEXT_LINE_MARKER))
|
|
157
|
+
return true;
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
98
160
|
/**
|
|
99
161
|
* Apply compiled rules against added lines from a diff.
|
|
100
162
|
* Returns all violations found.
|
|
163
|
+
* @param excludeFiles — file paths to skip (e.g., compiled-rules.json to avoid self-matches)
|
|
101
164
|
*/
|
|
102
|
-
export function applyRules(rules, diff) {
|
|
103
|
-
|
|
165
|
+
export function applyRules(rules, diff, excludeFiles) {
|
|
166
|
+
let additions = extractAddedLines(diff);
|
|
104
167
|
if (additions.length === 0 || rules.length === 0)
|
|
105
168
|
return [];
|
|
169
|
+
if (excludeFiles && excludeFiles.length > 0) {
|
|
170
|
+
const excluded = new Set(excludeFiles);
|
|
171
|
+
additions = additions.filter((a) => !excluded.has(a.file));
|
|
172
|
+
}
|
|
106
173
|
const violations = [];
|
|
107
174
|
for (const rule of rules) {
|
|
108
175
|
let re;
|
|
@@ -114,6 +181,14 @@ export function applyRules(rules, diff) {
|
|
|
114
181
|
continue;
|
|
115
182
|
}
|
|
116
183
|
for (const addition of additions) {
|
|
184
|
+
// Skip if rule has fileGlobs and this file doesn't match
|
|
185
|
+
if (rule.fileGlobs && rule.fileGlobs.length > 0) {
|
|
186
|
+
if (!fileMatchesGlobs(addition.file, rule.fileGlobs))
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
// Skip if suppressed via inline directive
|
|
190
|
+
if (isSuppressed(addition.line, addition.precedingLine))
|
|
191
|
+
continue;
|
|
117
192
|
if (re.test(addition.line)) {
|
|
118
193
|
violations.push({
|
|
119
194
|
rule,
|
|
@@ -154,6 +229,7 @@ export const CompilerOutputSchema = z.object({
|
|
|
154
229
|
compilable: z.boolean(),
|
|
155
230
|
pattern: z.string().optional(),
|
|
156
231
|
message: z.string().optional(),
|
|
232
|
+
fileGlobs: z.array(z.string()).optional(),
|
|
157
233
|
});
|
|
158
234
|
/**
|
|
159
235
|
* Parse the LLM's compilation response. Extracts JSON from the response text,
|
package/dist/compiler.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiler.js","sourceRoot":"","sources":["../src/compiler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,wDAAwD;AAExD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,0EAA0E;IAC1E,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,+DAA+D;IAC/D,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IACzB,sDAAsD;IACtD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,sEAAsE;IACtE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,yCAAyC;IACzC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;IAC1B,mDAAmD;IACnD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;
|
|
1
|
+
{"version":3,"file":"compiler.js","sourceRoot":"","sources":["../src/compiler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,wDAAwD;AAExD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,0E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