-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
It would be useful to be able to map path globs to supported languages, for cases where tracey's internal list of the extensions doesn't cut it. Motivating examples:
- extension-less shebanged executables ("scripts"), where
bin/foo,bin/bar,bin/bazmight all be bash, but will be completely ignored by tracey. In some cases it might be appropriate to rename those tobin/foo.shor something, but in others it might not. Plus, it doesn't have to be bash: their shebang might be#!/usr/bin/env nodeor cargo-script... - Tool files that need to be at particular filenames but are written in a covered language.
- Legit extensions for the language that aren't covered by tracey's hardcoded list.
The proposal is for a mapping of globs to language tags (essentially the inverse of "Option B" from #9) which is specified to be "first match wins". Then the internal extension mapping would append to the configured list. For example:
@schema {id crate:tracey-config@1, cli tracey}
specs (
{
name example
include (docs/spec/**/*.md)
impls (
{
name main
include (
installer/**/*.rs
admin/**/*.pl
bin/*
)
language (
bin/foobar Perl
bin/* Shell
)
}
)
}
)
Implementation-wise, this would probably involve an enum of supported languages, that is figured from this mapping for each path, and then used throughout; incidentally I've noticed tracey contains at least three different places where it maps extensions to filetypes...
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels