import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo

This commit is contained in:
Roy Tam 2018-01-19 03:59:58 +08:00
commit dcd9973243
150858 changed files with 23884658 additions and 0 deletions

View file

@ -0,0 +1,21 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
def lint(files, **lintargs):
return 1
LINTER = {
'name': "BadReturnCodeLinter",
'description': "Returns an error code no matter what",
'include': [
'files',
],
'type': 'external',
'extensions': ['.js', '.jsm'],
'payload': lint,
}

View file

@ -0,0 +1,13 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
LINTER = {
'name': "ExplicitPathLinter",
'description': "Only lint a specific file name",
'rule': 'no-foobar',
'include': [
'no_foobar.js',
],
'type': 'string',
'payload': 'foobar',
}

View file

@ -0,0 +1,30 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from mozlint import result
def lint(files, **lintargs):
results = []
for path in files:
with open(path, 'r') as fh:
for i, line in enumerate(fh.readlines()):
if 'foobar' in line:
results.append(result.from_linter(
LINTER, path=path, lineno=i+1, column=1, rule="no-foobar"))
return results
LINTER = {
'name': "ExternalLinter",
'description': "It's bad to have the string foobar in js files.",
'include': [
'files',
],
'type': 'external',
'extensions': ['.js', '.jsm'],
'payload': lint,
}

View file

@ -0,0 +1,10 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
LINTER = {
'name': "BadExcludeLinter",
'description': "Has an invalid exclude directive.",
'exclude': [0, 1], # should be a list of strings
'type': 'string',
'payload': 'foobar',
}

View file

@ -0,0 +1,9 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
LINTER = {
'name': "BadExtensionLinter",
'description': "Has an invalid file extension.",
'type': 'string',
'payload': 'foobar',
}

View file

@ -0,0 +1,10 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
LINTER = {
'name': "BadIncludeLinter",
'description': "Has an invalid include directive.",
'include': 'should be a list',
'type': 'string',
'payload': 'foobar',
}

View file

@ -0,0 +1,9 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
LINTER = {
'name': "BadTypeLinter",
'description': "Has an invalid type.",
'type': 'invalid',
'payload': 'foobar',
}

View file

@ -0,0 +1,7 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
LINTER = {
'name': "MissingAttrsLinter",
'description': "Missing type and payload",
}

View file

@ -0,0 +1,4 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# No LINTER variable

View file

@ -0,0 +1,19 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from mozlint.errors import LintException
def lint(files, **lintargs):
raise LintException("Oh no something bad happened!")
LINTER = {
'name': "RaisesLinter",
'description': "Raises an exception",
'type': 'external',
'payload': lint,
}

View file

@ -0,0 +1,15 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
LINTER = {
'name': "RegexLinter",
'description': "Make sure the string 'foobar' never appears "
"in a js variable file because it is bad.",
'rule': 'no-foobar',
'include': [
'**/*.js',
'**/*.jsm',
],
'type': 'regex',
'payload': 'foobar',
}

View file

@ -0,0 +1,15 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
LINTER = {
'name': "StringLinter",
'description': "Make sure the string 'foobar' never appears "
"in browser js files because it is bad.",
'rule': 'no-foobar',
'include': [
'**/*.js',
'**/*.jsm',
],
'type': 'string',
'payload': 'foobar',
}

View file

@ -0,0 +1,28 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
def lint(files, logger, **kwargs):
for path in files:
with open(path, 'r') as fh:
for i, line in enumerate(fh.readlines()):
if 'foobar' in line:
logger.lint_error(path=path,
lineno=i+1,
column=1,
rule="no-foobar")
LINTER = {
'name': "StructuredLinter",
'description': "It's bad to have the string foobar in js files.",
'include': [
'files',
],
'type': 'structured_log',
'extensions': ['.js', '.jsm'],
'payload': lint,
}