Bug 1596911 - Activate the license lint on more extensions r=Gijs
☠☠ backed out by 2c912e46295e ☠ ☠
authorSylvestre Ledru <sledru@mozilla.com>
Thu, 21 Nov 2019 18:06:38 +0000
changeset 503409 394f75b9488a77819cd2b2f381e81961435665c1
parent 503408 64b604856d79fd17ff74c45157973911e495a0c4
child 503410 b17ea5cb77148d291bdcb10f2d8bc598b5cd67c2
push id36833
push userbtara@mozilla.com
push dateFri, 22 Nov 2019 21:40:53 +0000
treeherdermozilla-central@2c912e46295e [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 - Activate the license lint on more extensions r=Gijs Differential Revision: https://phabricator.services.mozilla.com/D53266
tools/lint/license.yml
tools/lint/license/__init__.py
--- a/tools/lint/license.yml
+++ b/tools/lint/license.yml
@@ -58,24 +58,29 @@ license:
         # By design
         - tools/lint/test/
         # generated file
         - xpcom/ds/HTMLAtoms.py
     extensions:
         - .c
         - .cc
         - .cpp
+        - .css
+        - .dtd
+        - .ftl
         - .h
         - .html
         - .js
         - .jsm
         - .jsx
         - .m
         - .mm
+        - .properties
         - .py
         - .rs
+        - .svg
         - .xhtml
         - .xml
         - .xul
     support-files:
         - 'tools/lint/license/**'
     type: external
     payload: license:lint
--- a/tools/lint/license/__init__.py
+++ b/tools/lint/license/__init__.py
@@ -130,17 +130,21 @@ def fix_me(filename):
             start = "   - "
             end = ""
             if i == 0:
                 # first line, we have the <!--
                 start = "<!-- "
             if i == 2 or (i == 1 and test):
                 # Last line, we end by -->
                 end = " -->"
-            license.append(start + l.strip() + end + "\n")
+            license.append(start + l.strip() + end)
+            if ext != '.svg' or end == "":
+                # When dealing with an svg, we should not have a space between
+                # the license and the content
+                license.append("\n")
         add_header(filename, license)
         return
 
 
 def lint(paths, config, fix=None, **lintargs):
     files = list(expand_exclusions(paths, config, lintargs['root']))
 
     licenses = load_valid_license()