Auto detect type of extension-less files #127
Labels
in:core
MLP core module
is:feature
New feature
stale
Inactive items that will be automatically closed if not resurrected
I'd like to adhere to https://google.github.io/styleguide/shell.xml which expects bash files to not have any extension. Currently I am not aware of a configuration option that would allow the license-maven-plugin to correctly deal with this situation.
My suggestion would be to add a boolean option "autoDetect" which, if set to true, will try to find some magic line within the first min(n lines, m bytes) of an extension-less file (unless the whole filename matches an extension or the file is ignored). By "magic line" I mean stuff like "#!/bin/bash".
There would have to be another option like "mapping" (e.g. autoDetectMapping) which allows the user to specify regular expressions that match the magic line, e.g.: <autoDetectMappings><autoDetectMapping><search>#!/bin/bash</search><style>SCRIPT_STYLE</style></autoDetectMapping></autoDetectMappings>
Would there be interest in such a feature? If so, I'd like to give it a try.
The text was updated successfully, but these errors were encountered: