Skip to content

Commit f68fbc0

Browse files
author
merge-queue-bot
committed
Merge PR #224: Unify glob matcher to doublestar across all surfaces
2 parents fc274f6 + a0c9ad2 commit f68fbc0

33 files changed

Lines changed: 759 additions & 291 deletions

File tree

.claude/skills/proto.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ description: 'string & != ""'
1111
---
1212

1313
## ...
14+
1415
<?allow-empty-section?>

.mdsmith.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ rules:
7878
git-hook-sync: true
7979

8080
overrides:
81-
- files: ["CLAUDE.md"]
81+
- glob: ["CLAUDE.md"]
8282
rules:
8383
line-length:
8484
max: 200
@@ -87,20 +87,20 @@ overrides:
8787
- tables
8888
- urls
8989
blank-line-around-lists: false
90-
- files: [".claude/skills/*/SKILL.md",
90+
- glob: [".claude/skills/*/SKILL.md",
9191
".github/copilot-pr-fixup.md",
9292
".github/AGENTS-PR-FIXUP.md"]
9393
rules:
9494
max-file-length:
9595
max: 600
96-
- files: [".claude/skills/*/SKILL.md"]
96+
- glob: [".claude/skills/*/SKILL.md"]
9797
rules:
9898
# required-structure.schema for SKILL.md files comes
9999
# from the `skill` kind; this override only carries
100100
# the SKILL-specific heading-rule tweaks.
101101
first-line-heading: false
102102
heading-increment: false
103-
- files: ["AGENTS.md", ".github/copilot-instructions.md"]
103+
- glob: ["AGENTS.md", ".github/copilot-instructions.md"]
104104
rules:
105105
line-length:
106106
max: 200
@@ -116,15 +116,15 @@ overrides:
116116
level: 1
117117
cross-file-reference-integrity: true
118118
catalog: false
119-
- files: ["docs/development/index.md"]
119+
- glob: ["docs/development/index.md"]
120120
rules:
121121
first-line-heading: false
122122
heading-increment: false
123-
- files: ["internal/rules/index.md"]
123+
- glob: ["internal/rules/index.md"]
124124
rules:
125125
table-readability:
126126
max-rows: 45
127-
- files: ["README.md"]
127+
- glob: ["README.md"]
128128
rules:
129129
line-length:
130130
max: 100
@@ -138,24 +138,24 @@ overrides:
138138
max-rows: 40
139139
paragraph-structure:
140140
max-sentences: 30
141-
- files: ["PLAN.md"]
141+
- glob: ["PLAN.md"]
142142
rules:
143143
table-readability:
144144
max-rows: 80
145145
max-column-width-ratio: 65
146-
- files: ["internal/rules/MDS002-heading-style/good/setext.md"]
146+
- glob: ["internal/rules/MDS002-heading-style/good/setext.md"]
147147
rules:
148148
heading-style:
149149
style: setext
150-
- files: ["internal/rules/MDS010-fenced-code-style/good/tilde.md"]
150+
- glob: ["internal/rules/MDS010-fenced-code-style/good/tilde.md"]
151151
rules:
152152
fenced-code-style:
153153
style: tilde
154-
- files: ["internal/rules/MDS016-list-indent/good/spaces-4.md"]
154+
- glob: ["internal/rules/MDS016-list-indent/good/spaces-4.md"]
155155
rules:
156156
list-indent:
157157
spaces: 4
158-
- files: ["docs/background/*.md"]
158+
- glob: ["docs/background/**/*.md"]
159159
rules:
160160
line-length:
161161
stern: true
@@ -167,13 +167,13 @@ overrides:
167167
tokens-per-word: 1.33
168168
tokenizer: builtin
169169
encoding: cl100k_base
170-
- files: ["docs/development/pr-fixup-workflow.md"]
170+
- glob: ["docs/development/pr-fixup-workflow.md"]
171171
rules:
172172
first-line-heading: false
173173
heading-increment: false
174174
max-file-length:
175175
max: 330
176-
- files: ["docs/guides/*.md"]
176+
- glob: ["docs/guides/**/*.md"]
177177
rules:
178178
line-length:
179179
max: 600
@@ -195,7 +195,7 @@ overrides:
195195
paragraph-structure:
196196
max-sentences: 12
197197
max-words-per-sentence: 120
198-
- files: ["docs/security/*.md", "!docs/security/proto.md"]
198+
- glob: ["docs/security/*.md", "!docs/security/proto.md"]
199199
rules:
200200
line-length:
201201
max: 600
@@ -214,7 +214,7 @@ overrides:
214214
tokens-per-word: 1.33
215215
tokenizer: builtin
216216
encoding: cl100k_base
217-
- files: ["docs/research/**"]
217+
- glob: ["docs/research/**"]
218218
rules:
219219
first-line-heading: false
220220
heading-increment: false
@@ -285,13 +285,13 @@ kinds:
285285
# would strip the schema from proto.md, so it is not used
286286
# here.
287287
kind-assignment:
288-
- files: ["**/proto.md"]
288+
- glob: ["**/proto.md"]
289289
kinds: [proto]
290-
- files: ["plan/*.md"]
290+
- glob: ["plan/*.md"]
291291
kinds: [plan]
292-
- files: ["internal/rules/proto.md", "internal/rules/MDS*/README.md"]
292+
- glob: ["internal/rules/proto.md", "internal/rules/MDS*/README.md"]
293293
kinds: [rule-readme]
294-
- files: [".claude/skills/proto.md", ".claude/skills/*/SKILL.md"]
294+
- glob: [".claude/skills/proto.md", ".claude/skills/*/SKILL.md"]
295295
kinds: [skill]
296-
- files: ["docs/security/*.md"]
296+
- glob: ["docs/security/*.md"]
297297
kinds: [security-note]

PLAN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ footer: |
3131
| 112 || opus | [Markdown convention bundles for MDS034](plan/112_flavor-profiles.md) |
3232
| 113 | 🔲 | sonnet | [User-defined Markdown conventions](plan/113_user-defined-profiles.md) |
3333
| 114 || sonnet | [MDS034 message clarity and flavor-vs-rule docs](plan/114_mds034-message-and-flavor-vs-rule-docs.md) |
34-
| 120 | 🔲 | sonnet | [Unify glob matcher and field naming across mdsmith](plan/120_glob-unification.md) |
34+
| 120 | | sonnet | [Unify glob matcher and field naming across mdsmith](plan/120_glob-unification.md) |
3535
| 121 | 🔲 | opus | [Expose mdsmith to VS Code via Language Server Protocol](plan/121_vscode-integration.md) |
3636
| 121 || sonnet | [Review and centralize YAML handling](plan/121_yaml-handling-review.md) |
3737
| 122 | 🔲 | sonnet | [VS Code hover help and palette commands](plan/122_vscode-hover-and-palette.md) |

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ ignore:
150150
- "vendor/**"
151151

152152
overrides:
153-
- files: ["CHANGELOG.md"]
153+
- glob: ["CHANGELOG.md"]
154154
rules:
155155
no-duplicate-headings: false
156156
```

cmd/mdsmith/explain_e2e_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const explainCfg = `kinds:
1919
line-length:
2020
max: 30
2121
kind-assignment:
22-
- files: ["short.md"]
22+
- glob: ["short.md"]
2323
kinds: [short]
2424
rules:
2525
line-length:

cmd/mdsmith/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,7 @@ purpose (schema, template, fragment, prompt, …) without repeating overrides.
10801080
DECLARATION
10811081
10821082
Declare kinds under the kinds: key. The body has the same shape as an
1083-
override entry (rules:, categories:) — minus files:, since files are bound
1083+
override entry (rules:, categories:) — minus glob:, since files are bound
10841084
to kinds separately:
10851085
10861086
kinds:
@@ -1109,9 +1109,9 @@ Duplicate names are dropped after their first occurrence. Referencing an
11091109
undeclared kind is a config error.
11101110
11111111
kind-assignment:
1112-
- files: ["plan/[0-9]*_*.md"]
1112+
- glob: ["plan/[0-9]*_*.md"]
11131113
kinds: [plan]
1114-
- files: ["**/proto.md"]
1114+
- glob: ["**/proto.md"]
11151115
kinds: [proto]
11161116
11171117
MERGE ORDER

demo/kinds/.mdsmith.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ kinds:
1212
max: 100
1313

1414
kind-assignment:
15-
- files: ["plan/*.md"]
15+
- glob: ["plan/*.md"]
1616
kinds: [plan]
17-
- files: ["prompt/*.md"]
17+
- glob: ["prompt/*.md"]
1818
kinds: [prompt]

demo/structure/.mdsmith.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ rules:
22
required-structure: true
33

44
overrides:
5-
- files: ["plan.md"]
5+
- glob: ["plan.md"]
66
rules:
77
required-structure:
88
schema: schema.md

docs/guides/directives/enforcing-structure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ overrides:
5555

5656
```yaml
5757
overrides:
58-
- files: ["internal/rules/*/README.md"]
58+
- glob: ["internal/rules/*/README.md"]
5959
rules:
6060
required-structure:
6161
schema: internal/rules/proto.md

docs/guides/file-kinds.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ names that fit its repository.
2020

2121
Kinds live under the `kinds:` key in `.mdsmith.yml`. Each
2222
kind body has the same shape as an entry under
23-
`overrides:`, minus `files:` — files are bound to kinds
23+
`overrides:`, minus `glob:` — files are bound to kinds
2424
separately.
2525

2626
```yaml
@@ -78,17 +78,17 @@ order.
7878
### Glob assignment
7979

8080
`kind-assignment:` is a list of entries. Each entry has
81-
`files:` (the same glob shape as `overrides:` and
82-
`ignore:`) and `kinds:` (the names to apply).
81+
`glob:` (the same doublestar pattern syntax as `overrides:`
82+
and `ignore:`) and `kinds:` (the names to apply).
8383

8484
```yaml
8585
kind-assignment:
86-
- files: ["**/proto.md"]
86+
- glob: ["**/proto.md"]
8787
kinds: [proto]
88-
- files: ["plan/*.md"]
88+
- glob: ["plan/*.md"]
8989
kinds: [plan]
90-
- files: ["internal/rules/proto.md",
91-
"internal/rules/MDS*/README.md"]
90+
- glob: ["internal/rules/proto.md",
91+
"internal/rules/MDS*/README.md"]
9292
kinds: [rule-readme]
9393
```
9494

@@ -133,7 +133,7 @@ order from lowest to highest precedence:
133133
1. The rule's built-in defaults.
134134
2. Top-level `rules:` defaults.
135135
3. Each kind in the file's effective kind list, in order.
136-
4. Each `overrides:` entry whose `files:` glob matches,
136+
4. Each `overrides:` entry whose `glob:` matches,
137137
in config order.
138138

139139
Across all four layers the config is **deep-merged**
@@ -204,7 +204,7 @@ against the merge rules above:
204204

205205
1. Read the file's front matter for any `kinds:` field.
206206
2. Walk `kind-assignment:` top to bottom and collect
207-
every entry whose `files:` glob matches the file.
207+
every entry whose `glob:` matches the file.
208208
3. Concatenate the two lists, dropping duplicates after
209209
first occurrence — that's the effective kind list.
210210
4. Apply built-in defaults, then the top-level `rules:`

0 commit comments

Comments
 (0)