-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion: Move all grammar-related metadata to grammars.yml
#4990
Comments
That would be pretty cool, actually! Maybe as a flag with the |
No need. Most of the time, the files are located somewhere predictable. Atom actually forces you to place them in the |
Ah okay... So it's not that many repos that are structured differently. But I could add a |
This is more of an RFC to discuss a potential enhancement to Linguist. The changes involved are many, and they touch lots of different components that behave similarly, but operate independently. In other words, there's nothing you need to worry about WRT your PR. 😉 |
I get that, I was trying to understand how you envision this to work from a users perspective haha |
The
since users will try all sorts of things, and it's better for a program to be maximally permissive about what input it accepts, rather than barking at users "to provide a path relative to the upstream repository's root directory". @lildude I don't think I've overdone that script enough, should I add a man page? 😁 |
This sounds like an interesting idea, though is likely to be a lot of work. Is all that work really worth the effort for the few corner cases not correctly handled now? Without thinking too hard about it, a few quick points come to mind:
So if anything, this change would really be consolidating some of the current Feel free to start a PoC PR and we can track and discuss things as it progresses. |
Why are |
@johnmays Not really. If we were to move it, it could probably go into |
I see. That makes sense. |
Currently, metadata pertaining to grammars and case-by-case exceptions are handled in four different places:
.gitmodules
specifies URLs.grammars.yml
specifies scopes.tools/grammars/compiler/data.go
specifies scope-maps and case-by-case overridesvendor/licenses/config.yml
identifies (for Licensee) which grammars had their licenses manually-reviewedMoreover, the difficulties related by @pastra98 made me realise there's more we could be doing with regards to locating grammar and license files. Specifically, we should be able to provide a manual path if need be — the currently hardcoded search locations can remain the default for grammars without a
src:
field defined, or whatever.Here's how it *might* look.
Thoughts?
EDIT: Oh yeah, it'd also be nice if we refined our terminology a little, because it's confusing to refer to both a TextMate compatible grammar file and the submodule containing it as a "grammar" (maybe "grammar-source" for the latter?) Given most of the grammars I write nowadays are almost exclusively added to
language-etc
(a super-bundle of whatever I can't be fucked publishing separately anymore, but nothing specific), it'd be a helpful distinction.The text was updated successfully, but these errors were encountered: