Open bedge opened 7 years ago
Note also that this is the recommended encoding from https://docs.python.org/2.3/whatsnew/section-encodings.html https://www.python.org/dev/peps/pep-0263/#defining-the-encoding
Was able to work around this by specifying an alternate syntax file:
diff --git a/contrib/syntax.yml b/contrib/syntax.yml
index 8b6cc75..7f99efc 100644
--- a/contrib/syntax.yml
+++ b/contrib/syntax.yml
@@ -39,7 +39,7 @@ perl:
# vim: set fileencoding=<encoding name> :
python:
ext: ['.py']
- after: ['^#!', '^#.*coding:', '^#.*coding=', '^#.*fileencoding=']
+ after: ['^#!']
comment:
open: '\n'
close: '\n'
However, IMO it's a bug as it can inject the license more than once in a source file.
I agree that the original after...
line above covers more cases, but it should only insert on the first match.
Subject says it all.
Used:
copyright-header --guess-extension --license-file LICENSE.txt --add-path . --output-dir .
Test case: