Commit 0194789
feat(naming): widen the Roblox allowed-words list to members and trailing capitals (#664)
* fix(naming): allow Roblox names that end in a capital
The filter tested each name in isolation, but the failure mode is the
name embedded in a longer identifier. Motor6D holds no pair of its own,
so it was dropped - yet targetMotor6DPart, motor6DWeld and Motor6DConfig
all error, because the trailing D lands against the next word's capital.
Adds a trailing-capital arm to the predicate, which picks up Motor6D,
Path2D, Path3D, RotateP and RotateV, and lets Path2D absorb
Path2DControlPoint. 67 words -> 71.
Word-initial position is still uncovered: matching is case-sensitive and
strictCamelCase lowercases the first word, so motor6DWeld stays an error
while targetMotor6DPart passes. Same limitation flawless documents for
cframeGoal. Noted in the README.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* feat(naming): scrape member names for the allowed-words list
The list was built from declared type names only, on the reasoning that
members are reached as property accesses and never declared. That holds
for enum items but not for properties: a variable is as likely to be
named after the property it holds as after a type, and no type is called
ZIndex, so autoZIndex stayed an error. ZIndexBehavior was in the list,
but a word has to match literally, and autoZIndex does not contain it.
Scrapes interface members from roblox.d.ts and None.d.ts. Enum items stay
out - Enum.TextXAlignment.Center really is only ever an access. 71 words
-> 171, and ZIndex now absorbs ZIndexBehavior.
Members also drag in bare capitals (Vector3.X and friends), which qualify
under the trailing-capital arm. They are inert rather than dangerous -
folding only lowercases a word's tail and a single capital has none, so
applyAllowedWords returns the name unchanged - but nothing could ever
prune them, so needsAllowing now rejects anything shorter than two
characters.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(naming): drop method names from the allowed-words list
The member scrape took every member, so `Color3.ToHSV` put `ToHSV` in the
list and `colorToHSV` became a legal variable. A property lends its
spelling to whatever holds it, which is the whole reason to scrape
members, but a call spells the API out at the call site, where no naming
rule applies. `toHsv` is the name to want.
Restricts the member pattern to data properties. All three declaration
forms count as a method - `ToHSV(this: Color3): T`, `Name<T>(value: T): T`
and `toHSV: (color: Color3) => T` - and the last needs the lookahead to
skip its own whitespace, since a negative lookahead after `\s*` backtracks
to zero width and then tests the space rather than the `(`.
171 words -> 139, all 32 of them function-only. Nothing was masking a
property during pruning, so no word comes back.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* feat(deps): take the flawless 1.9.0 word-initial fix
`allowedWords` matched case-sensitively, so a word never matched at the
start of a name: `targetMotor6DPart` passed but `motor6DWeld` did not.
flawless 1.9.0 matches the lowercased-initial form at index 0, which is
the only spelling `strictCamelCase` permits there.
Mirrors the change in the generator's copy of `applyAllowedWords`, which
prunes the list by asking the question the rule will ask. The output is
unchanged at 139 words - nothing in `@rbxts/types` was being kept only
because index 0 could not match. Drops the README caveat.
`pnpm gen` also picks up `flawless/no-shared-mocks`, new in the bump and
not enabled here.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>1 parent 13e6cb9 commit 0194789
8 files changed
Lines changed: 340 additions & 37 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
793 | 793 | | |
794 | 794 | | |
795 | 795 | | |
| 796 | + | |
796 | 797 | | |
| 798 | + | |
| 799 | + | |
797 | 800 | | |
798 | 801 | | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
799 | 806 | | |
800 | 807 | | |
801 | 808 | | |
| |||
814 | 821 | | |
815 | 822 | | |
816 | 823 | | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
817 | 829 | | |
818 | 830 | | |
819 | 831 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
24 | 33 | | |
25 | 34 | | |
26 | 35 | | |
| |||
37 | 46 | | |
38 | 47 | | |
39 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
40 | 64 | | |
41 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
42 | 73 | | |
43 | 74 | | |
44 | 75 | | |
45 | 76 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
52 | 83 | | |
53 | 84 | | |
54 | 85 | | |
| |||
58 | 89 | | |
59 | 90 | | |
60 | 91 | | |
61 | | - | |
| 92 | + | |
62 | 93 | | |
63 | 94 | | |
64 | 95 | | |
65 | 96 | | |
66 | 97 | | |
67 | | - | |
| 98 | + | |
68 | 99 | | |
69 | 100 | | |
70 | 101 | | |
| |||
83 | 114 | | |
84 | 115 | | |
85 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
86 | 128 | | |
87 | 129 | | |
88 | 130 | | |
89 | 131 | | |
90 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
91 | 135 | | |
92 | 136 | | |
93 | 137 | | |
| |||
99 | 143 | | |
100 | 144 | | |
101 | 145 | | |
102 | | - | |
103 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
104 | 153 | | |
105 | 154 | | |
106 | 155 | | |
| |||
132 | 181 | | |
133 | 182 | | |
134 | 183 | | |
135 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
136 | 187 | | |
137 | 188 | | |
138 | 189 | | |
139 | 190 | | |
140 | 191 | | |
141 | 192 | | |
142 | 193 | | |
143 | | - | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
144 | 201 | | |
145 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
146 | 249 | | |
147 | 250 | | |
148 | 251 | | |
149 | 252 | | |
150 | | - | |
151 | | - | |
152 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
153 | 257 | | |
154 | 258 | | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
163 | 265 | | |
164 | 266 | | |
165 | 267 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
| |||
0 commit comments