-
Notifications
You must be signed in to change notification settings - Fork 8
Improve similar header matching #3
Comments
For the immediate client aka projectriff, matching extra commented newlines is enough (and is now done). |
Made the comparison case-insensitive, ignore starting whitespace chars as well as trailing ones and dots |
One example where
And some files have headers similar but with
Running To solve this issue, here is a trick one can apply. Parameterize the protocol:
Add the corresponding definition in the JSON configuration:
Run Once everything is normalized, you can remove the parameter, come back to the initial header license template and run You do not need to resort to this if |
Current shortcoming: if the new license header contains an extra newline somewhere, that causes similar headers to not be matched at all. Supporting this should not require to change the whole approach (see #50). |
That would help users to perform the initial migration.
The idea could be: match the first comment section before the package declaration, if the header to insert is similar enough (for some value of enough), then let's replace it.
The text was updated successfully, but these errors were encountered: