We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subject says it all.
#!/usr/bin/env python # Copyright (c) blah # -*- coding: utf-8 -*- # Copyright (c) blah
Used: copyright-header --guess-extension --license-file LICENSE.txt --add-path . --output-dir .
copyright-header --guess-extension --license-file LICENSE.txt --add-path . --output-dir .
Test case:
%> cat test.py #!/usr/bin/env python # -*- coding: UTF-8 -*- %> copyright-header --guess-extension --license-file LICENSE.txt --add-path . --output-dir . SKIP ./LICENSE.txt; excluded UPDATE ./test.py [output-dir ./.] %> ls -lrt total 8 -rw-r--r--+ 1 bedge admin 198 Nov 6 13:09 LICENSE.txt -rw-r--r--+ 1 bedge admin 463 Nov 6 13:10 test.py %> cat test.py #!/usr/bin/env python # Copyright (c) blah # -*- coding: UTF-8 -*- # Copyright (c) blah
The text was updated successfully, but these errors were encountered:
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
Sorry, something went wrong.
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.
after...
osterman
No branches or pull requests
Subject says it all.
Used:
copyright-header --guess-extension --license-file LICENSE.txt --add-path . --output-dir .
Test case:
The text was updated successfully, but these errors were encountered: