Bug 1596911 - Add support in the autofix for the new extensions r=Gijs
authorSylvestre Ledru <sledru@mozilla.com>
Sat, 16 Nov 2019 00:29:17 +0000
changeset 502303 131bd5b63a028f04fc488bf9ed7f2c6d6b038810
parent 502302 ce117024e030669c35a537ce38e123c3cbffad21
child 502304 df333402f12666918a136e961c4f0bb0c6ffc40a
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1596911
milestone72.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1596911 - Add support in the autofix for the new extensions r=Gijs Depends on D53266 Differential Revision: https://phabricator.services.mozilla.com/D53267
tools/lint/license/__init__.py
--- a/tools/lint/license/__init__.py
+++ b/tools/lint/license/__init__.py
@@ -99,38 +99,38 @@ def fix_me(filename):
 
     license_template = TEMPLATES['mpl2_license']
     test = False
 
     if is_test(filename):
         license_template = TEMPLATES['public_domain_license']
         test = True
 
-    if ext in ['.cpp', '.c', '.cc', '.h', '.m', '.mm', '.rs', '.js', '.jsm', '.jsx']:
+    if ext in ['.cpp', '.c', '.cc', '.h', '.m', '.mm', '.rs', '.js', '.jsm', '.jsx', '.css']:
         for i, l in enumerate(license_template):
             start = " "
             end = ""
             if i == 0:
                 # first line, we have the /*
                 start = "/"
             if i == len(license_template) - 1:
                 # Last line, we end by */
                 end = " */"
             license.append(start + "* " + l.strip() + end + "\n")
 
         add_header(filename, license)
         return
 
-    if ext in ['.py'] or filename.endswith(".inc.xul"):
+    if ext in ['.py', '.ftl', '.properties'] or filename.endswith(".inc.xul"):
         for l in license_template:
             license.append("# " + l.strip() + "\n")
         add_header(filename, license)
         return
 
-    if ext in ['.xml', '.xul', '.html', '.xhtml']:
+    if ext in ['.xml', '.xul', '.html', '.xhtml', '.dtd', '.svg']:
         for i, l in enumerate(license_template):
             start = "   - "
             end = ""
             if i == 0:
                 # first line, we have the <!--
                 start = "<!-- "
             if i == 2 or (i == 1 and test):
                 # Last line, we end by -->