lluissm / license-header-checker

Command line utility to check whether the license headers are included in the source code files of a project. It can also insert/replace.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Suggestion] Regexp-based header detection

eutro opened this issue · comments

I'd like to suggest using a (customizable) regular expression instead of a hand-rolled parser for header comments. This would allow for different comment styles, not just /* ... */. The default regular expression could also be changed to support a wider array of delimiters.

I've implemented it for my own uses in my fork in a commit here eutro@63da1fa, please feel free to cherry-pick it, though I'm not enough of a Go expert to be sure I've done things properly (the tests pass, at least, and it works for my uses). The README would also need an update.

Hi @eutro,

Sorry for the late reply, I somehow missed your message.

Thank you for the suggestion and sample code, it is indeed an interesting addition.

I have started working on it here: #53

Closing this issue as the feature has been released in https://github.com/lluissm/license-header-checker/releases/tag/v1.5.0

Thank you again for the suggestion :)