We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5b46918 commit f451faeCopy full SHA for f451fae
.githooks/license_maintainer.py
@@ -97,8 +97,9 @@ def file_license(attributes):
97
with open(attributes, 'r+b') as f:
98
# Read in .gitattributes
99
tmp_mm = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
100
- # Removing all comment lines
101
- gitattributes = re.sub(r'(?m)^\#.*\n?', '', tmp_mm).split()
+ # Removing all comment lines and other attributes
+ pattern = re.compile("|".join([r'(?m)^\#.*\n?', r'^((?!licensefile).)*$']))
102
+ gitattributes = re.sub(pattern, '', tmp_mm).split()
103
# Obtain list of files
104
fil = [x for x in gitattributes if not 'licensefile' in x]
105
# Remove licensefile= from strings
0 commit comments