Improve sanity test, improve README. (#102)

This commit is contained in:
Felix Fontein 2022-07-20 23:05:15 +02:00 committed by GitHub
parent 7973f58661
commit 1abaa8e7ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View file

@ -21,7 +21,7 @@ def find_licenses(filename, relax=False):
spdx_license_identifiers = []
other_license_identifiers = []
has_copyright = False
with open(filename, 'r') as f:
with open(filename, 'r', encoding='utf-8') as f:
for line in f:
line = line.rstrip()
if 'Copyright ' in line:
@ -58,6 +58,7 @@ def main():
"""Main entry point."""
paths = sys.argv[1:] or sys.stdin.read().splitlines()
# The following paths are allowed to have no license identifier
no_comments_allowed = [
'changelogs/fragments/*.yml',
'tests/sanity/extra/*.json',
@ -68,11 +69,13 @@ def main():
'COPYING',
]
# Files of this name are allowed to be empty
empty_allowed = [
'.keep',
'__init__.py',
]
# These files are completely ignored
ignore_paths = [
'CHANGELOG.rst',
'changelogs/changelog.yaml',