Bug 1651832 - Add fluent mozlint check. r=darktrojan
authorRob Lemley <rob@thunderbird.net>
Mon, 13 Jul 2020 00:31:39 +0000
changeset 40009 f712495aa3c360180580ce31f32a889dfea560ac
parent 40008 539e414d1316f290cf47cec1a67a3b16d25b1b20
child 40010 53b9cbabf6cbc0a252b015d8a7ad24cd9caf596f
push id404
push userclokep@gmail.com
push dateMon, 24 Aug 2020 19:48:23 +0000
reviewersdarktrojan
bugs1651832
Bug 1651832 - Add fluent mozlint check. r=darktrojan Differential Revision: https://phabricator.services.mozilla.com/D83009
taskcluster/ci/source-test/mozlint.yml
tools/lint/l10n.yml
--- a/taskcluster/ci/source-test/mozlint.yml
+++ b/taskcluster/ci/source-test/mozlint.yml
@@ -161,16 +161,40 @@ license:
             - 'comm/**/*.m'
             - 'comm/**/*.mm'
             - 'comm/**/*.py'
             - 'comm/**/*.rs'
             - 'comm/**/*.xhtml'
             - 'comm/**/*.xml'
             - 'comm/**/*.xul'
 
+localization:
+    description: l10n tests for strings with errors
+    treeherder:
+        symbol: text(l1nt)
+    run:
+        mach: >
+            lint -v -l l10n -f treeherder
+            --config-path=comm/tools/lint
+            comm/*
+    attributes:
+        code-review: false
+    when:
+        files-changed:
+            - 'comm/calendar/locales/l10n.toml'
+            - 'comm/calendar/locales/en-US/**'
+            - 'comm/chat/locales/en-US/**'
+            - 'comm/mail/extensions/openpgp/content/**/*.ftl'
+            - 'comm/mail/locales/l10n.toml'
+            - 'comm/mail/locales/en-US/**'
+            - 'comm/mail/branding/thunderbird/locales/en-US/**'
+            - 'comm/tools/lint/l10n.yml'
+            - 'third_party/python/compare-locales/**'
+            - 'third_party/python/fluent/**'
+
 lintpref:
     description: Check for duplicates between all.js and StaticPrefList.yaml.
     treeherder:
         symbol: misc(pref)
     run:
         mach: >
             lint -v -l lintpref -f treeherder
             -f json:/builds/worker/mozlint.json
new file mode 100644
--- /dev/null
+++ b/tools/lint/l10n.yml
@@ -0,0 +1,41 @@
+---
+l10n:
+    description: Localization linter
+    # list of include directories of both
+    # comm/mail and comm/calendar l10n.tomls
+    # Paths that are not part of Thunderbird (editor/browser/devtools/etc)
+    # are included to
+    include:
+        - browser/locales/en-US/pdfviewer
+        - comm/calendar/locales/en-US
+        - comm/chat/locales/en-US
+        - comm/editor/ui/locales/en-US
+        - comm/mail/branding/thunderbird/locales/en-US
+        - comm/mail/extensions/openpgp
+        - comm/mail/locales/en-US
+        - comm/tools/lint/l10n.yml
+        - devtools/client/locales/en-US
+        - devtools/shared/locales/en-US
+        - devtools/startup/locales/en-US
+        - dom/locales/en-US
+        - netwerk/locales/en-US
+        - security/manager/locales/en-US
+        - toolkit/locales/en-US
+    # files not supported by compare-locales,
+    # and also not relevant to this linter
+    exclude:
+        - comm/mail/locales/en-US/all-l10n.js
+    l10n_configs:
+        - comm/mail/locales/l10n.toml
+        - comm/calendar/locales/l10n.toml
+    type: external
+    payload: commlint:lint_wrapper
+    wraps: python.l10n_lint:lint
+    setup: python.l10n_lint:gecko_strings_setup
+    support-files:
+        - 'comm/calendar/locales/l10n.toml'
+        - 'comm/mail/locales/l10n.toml'
+        - 'comm/tools/lint/l10n.yml'
+        - 'third_party/python/compare-locales/**'
+        - 'third_party/python/fluent/**'
+        - 'tools/lint/python/l10n_lint.py'