Source code

Revision control

Other Tools

1
# This Source Code Form is subject to the terms of the Mozilla Public
2
# License, v. 2.0. If a copy of the MPL was not distributed with this
3
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
5
from __future__ import absolute_import
6
7
8
def test(mod, path, entity=None):
9
import re
10
# ignore anything but Firefox
11
if mod not in ("netwerk", "dom", "toolkit", "security/manager",
12
"devtools/client", "devtools/shared", "devtools/startup",
13
"browser",
14
"browser/extensions/formautofill",
15
"browser/extensions/fxmonitor",
16
"browser/extensions/report-site-issue",
17
"extensions/spellcheck",
18
"other-licenses/branding/firefox",
19
"browser/branding/official",
20
"services/sync"):
21
return "ignore"
22
if mod not in ("browser", "extensions/spellcheck"):
23
# we only have exceptions for browser and extensions/spellcheck
24
return "error"
25
if entity is None:
26
# the only files to ignore are spell checkers
27
if mod == "extensions/spellcheck":
28
return "ignore"
29
return "error"
30
if mod == "extensions/spellcheck":
31
# l10n ships en-US dictionary or something, do compare
32
return "error"
33
if path == "defines.inc":
34
return "ignore" if entity == "MOZ_LANGPACK_CONTRIBUTORS" else "error"
35
36
if mod == "browser" and path == "chrome/browser-region/region.properties":
37
# only region.properties exceptions remain, compare all others
38
return ("ignore"
39
if (re.match(r"browser\.contentHandlers\.types\.[0-5]", entity) or
40
re.match(r"gecko\.handlerService\.schemes\.", entity) or
41
re.match(r"gecko\.handlerService\.defaultHandlersVersion", entity))
42
else "error")
43
return "error"