Skip to content

Commit

Permalink
Merge branch 'mozilla:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
nidafarooqui authored Dec 28, 2023
2 parents 2022bed + 3b94e9f commit fd6fd6e
Show file tree
Hide file tree
Showing 704 changed files with 81,640 additions and 74,951 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
root = true

[*.{js,jsm,json,html,css,pdf.link}]
[*.{js,jsm,mjs,json,html,css,pdf.link}]
charset = utf-8
end_of_line = lf
indent_size = 2
Expand Down
3 changes: 0 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@ l10n/
docs/
node_modules/
external/bcmaps/
external/webL10n/
external/builder/fixtures/
external/builder/fixtures_esprima/
external/quickjs/
src/shared/cffStandardStrings.js
src/shared/fonts_utils.js
test/tmp/
test/pdfs/
*~/
30 changes: 24 additions & 6 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,27 @@
"browser": true,
"es2022": true,
"worker": true,
"amd": true,
},

"globals": {
"PDFJSDev": false,
"exports": false,
"SystemJS": false,
"PDFJSDev": "readonly",
"__non_webpack_import__": "readonly",
},

"rules": {
// Plugins
"import/export": "error",
"import/exports-last": "error",
"import/extensions": ["error", "always", { "ignorePackages": true, }],
"import/first": "error",
"import/named": "error",
"import/no-cycle": "error",
"import/no-empty-named-blocks": "error",
"import/no-commonjs": "error",
"import/no-mutable-exports": "error",
"import/no-self-import": "error",
"import/no-unresolved": ["error", {
"ignore": ["pdfjs", "pdfjs-lib", "pdfjs-web", "pdfjs-fitCurve"]
"ignore": ["display", "pdfjs", "pdfjs-lib", "pdfjs-web", "web", "fluent-bundle", "fluent-dom"],
}],
"mozilla/avoid-removeChild": "error",
"mozilla/use-includes-instead-of-indexOf": "error",
Expand All @@ -47,21 +54,31 @@
"unicorn/no-abusive-eslint-disable": "error",
"unicorn/no-array-push-push": "error",
"unicorn/no-instanceof-array": "error",
"unicorn/no-invalid-remove-event-listener": "error",
"unicorn/no-new-buffer": "error",
"unicorn/no-typeof-undefined": ["error", {
"checkGlobalVariables": false,
}],
"unicorn/no-useless-promise-resolve-reject": "error",
"unicorn/no-useless-spread": "error",
"unicorn/prefer-array-find": "error",
"unicorn/prefer-array-flat": "error",
"unicorn/prefer-array-flat-map": "error",
"unicorn/prefer-array-index-of": "error",
"unicorn/prefer-array-some": "error",
"unicorn/prefer-at": "error",
"unicorn/prefer-date-now": "error",
"unicorn/prefer-dom-node-append": "error",
"unicorn/prefer-dom-node-remove": "error",
"unicorn/prefer-logical-operator-over-ternary": "error",
"unicorn/prefer-modern-dom-apis": "error",
"unicorn/prefer-modern-math-apis": "error",
"unicorn/prefer-negative-index": "error",
"unicorn/prefer-optional-catch-binding": "error",
"unicorn/prefer-regexp-test": "error",
"unicorn/prefer-string-replace-all": "error",
"unicorn/prefer-string-starts-ends-with": "error",
"unicorn/no-typeof-undefined": ["error", { "checkGlobalVariables": false, }],
"unicorn/prefer-ternary": ["error", "only-single-line"],

// Possible errors
"for-direction": "error",
Expand Down Expand Up @@ -123,6 +140,7 @@
"no-implied-eval": "error",
"no-iterator": "error",
"no-lone-blocks": "error",
"no-lonely-if": "error",
"no-multi-str": "error",
"no-new-func": "error",
"no-new-wrappers": "error",
Expand Down
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*.css text eol=lf
*.html text eol=lf
*.md text eol=lf
*.properties text eol=lf
*.ftl text eol=lf
*.yml text eol=lf
*.json text eol=lf
*.config text eol=lf
Expand Down
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
l10n/en-US/*.ftl @mozilla/pdfjs-l10n
27 changes: 27 additions & 0 deletions .github/fluent_linter_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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/.

# See https://github.com/mozilla-l10n/moz-fluent-linter/blob/main/src/fluent_linter/config.yml
# for details

---
ID01:
enabled: true
exclusions:
messages: []
files: []
ID02:
enabled: true
min_length: 9
exclusions:
messages: []
files: []
CO01:
enabled: true
brands:
- Firefox
- Mozilla
exclusions:
files: []
messages: []
1 change: 1 addition & 0 deletions .github/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
moz-fluent-linter==0.4.*
24 changes: 17 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,30 @@ jobs:
name: Test
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: [18, lts/*, latest]

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Use Node.js 18 LTS
uses: actions/setup-node@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: ${{ matrix.node-version }}

- name: Install Gulp
run: npm install -g gulp-cli

- name: Install other dependencies
run: npm install -f
run: npm install

- name: Run external tests
run: gulp externaltest

- name: Run tests
run: gulp ci-test
- name: Run CLI unit tests
run: gulp unittestcli
10 changes: 6 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
queries: security-and-quality

- name: Autobuild CodeQL
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
42 changes: 42 additions & 0 deletions .github/workflows/fluent_linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Lint Fluent Reference Files
on:
push:
paths:
- 'l10n/en-US/**.ftl'
- '.github/fluent_linter_config.yml'
- '.github/workflows/fluent_linter.yml'
branches:
- master
pull_request:
paths:
- 'l10n/en-US/**.ftl'
- '.github/fluent_linter_config.yml'
- '.github/workflows/fluent_linter.yml'
branches:
- master
workflow_dispatch:
permissions:
contents: read

jobs:
lint:
name: Lint
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Use Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'

- name: Install Fluent dependencies
run: |
pip install -r .github/requirements.txt
- name: Lint Fluent reference files
run: |
moz-fluent-lint ./l10n/en-US --config .github/fluent_linter_config.yml
64 changes: 64 additions & 0 deletions .github/workflows/font_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Font tests
on:
push:
paths:
- 'gulpfile.mjs'
- 'src/**'
- 'test/test.mjs'
- 'test/font/**'
- '.github/workflows/font_tests.yml'
branches:
- master
pull_request:
paths:
- 'gulpfile.mjs'
- 'src/**'
- 'test/test.mjs'
- 'test/font/**'
- '.github/workflows/font_tests.yml'
branches:
- master
workflow_dispatch:
permissions:
contents: read

jobs:
test:
name: Test

strategy:
fail-fast: false
matrix:
node-version: [lts/*]
os: [windows-latest, ubuntu-latest]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install Gulp
run: npm install -g gulp-cli

- name: Install other dependencies
run: npm install

- name: Use Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'

- name: Install Fonttools
run: pip install fonttools

- name: Run font tests
run: gulp fonttest --headless
37 changes: 37 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Lint
on: [push, pull_request]
permissions:
contents: read

jobs:
lint:
name: Lint
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: [lts/*]

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install Gulp
run: npm install -g gulp-cli

- name: Install other dependencies
run: npm install

- name: Run lint
run: gulp lint

- name: Run lint-chromium
run: gulp lint-chromium
Loading

0 comments on commit fd6fd6e

Please sign in to comment.