-
-
Notifications
You must be signed in to change notification settings - Fork 561
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
Support "filenames" key, mk. 2 #115
Conversation
} | ||
} | ||
|
||
let extension = fs::get_extension(&entry) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that extension matching should be first. Just so it's a clear set of precedences in determining the language.
(extension) > (filename) > (shebang)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That will unfortunately prevent CMake from working. If you think it's the right thing I can implement it, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The canonical CMake filename is CMakeLists.txt
, for whatever reason. Maybe to make them easier for Windows users to edit?
If we detect by extension first, that will always be detected as plaintext, despite being a very different language from plaintext.
Similar cases are Cargo.toml
and package.json
, although those are more straightforwardly TOML and JSON files, so I understand why you don't want to count them separately.
Note that the filename
key matches the entire filename, not just the extension-stripped stem. So in this scheme, Makefile.bananas
won't be detected as anything, since there's nothing with the Makefile.bananas
filename, and nothing with the bananas
extension.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you choose the entire filename over the stem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to support CMakeLists.txt, mainly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, seems fine with me, if you could rebase it onto the latest I'll be happy to merge it in.
Rebased! |
Reopening #109 with comments addressed. (It took a while to get back to it, I've been swamped with work.)
We now support: