Closed soc221b closed 11 months ago
Hey @iendeavor, could you please provide more context
thank you
Hi, @loeffel-io Thanks for your quick reply.
For example, we might have some files containing the abbreviation "SMS", but it violates the PascalCase rule:
ls:
.ts: PascalCase
path/
│
└─ to/
│
├─ EmailService.ts # valid
│
└─ SMSService.ts # invalid
Hey @iendeavor
for this you can use the regex rule and allow only specific values or the negative of them with something like
ls:
to:
.ts: regex:(Email|Foo|Bla)Service # allow EmailService, FooService, BlaService
the negative could be this, but this isn't supported by re2 and go
ls:
to:
.ts: regex:(?!HTTP|SMS).*Service # do not allow HTTPService, SMSService
for this a not_regex
rule could make sense
Yes, this makes sense for the example mentioned earlier, but we might have any name anywhere in the filename, and we also want to validate it based on specific rules, like:
ls:
.js: camelCase
../
│
└─ bundle/
│
├─ assetCatalogIOS.js
│
├─ getAssetDestPathIOS.js
│
└─ __tests__/
│
└─ getAssetDestPathIOS-test.js
Example 2: https://github.com/apple/swift/tree/main/lib/AST
ls:
.cpp: PascalCase
../
│
├─ AST/
│ │
│ ├─ ASTScope.cpp
│ │
│ ├─ ASTScopePrinting.cpp
│ │
│ └─ ASTScopeSourceRange.cpp
│
└─ RemoteAST/
│
└─ RemoteAST.cpp
what about
ls:
to:
.ts: regex:(Email|Foo|Bla)Service | camelCase # allow EmailService, FooService, BlaService and all camelCase
filenames like getAssetDestPathIOS-test.js
are an anti pattern imo
Closing this for now - please let me know if you have any further questions
I'm wondering if this is useful to anyone else 🤔:
Thank you~