-
Notifications
You must be signed in to change notification settings - Fork 450
Add GitHub workflow to check Fluent reference files #5647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5cbcf76
ae066fb
2136efd
2b7b8a0
f68c8a2
e9ff14f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # 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 | ||
|
|
||
| --- | ||
| # Check brand names | ||
| CO01: | ||
| enabled: true | ||
| brands: | ||
| - Firefox | ||
| - Mozilla | ||
| - Profiler | ||
| exclusions: | ||
| files: [] | ||
| messages: [] | ||
| # Enforce variable comments | ||
| VC: | ||
| disabled: false | ||
| # Enforce placeholder style, e.g. { $variable } | ||
| PS01: | ||
| disabled: false |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| moz-fluent-linter~=0.4.9 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: Lint Reference Files | ||
| on: | ||
| push: | ||
| paths: | ||
| - 'locales/en-US/*.ftl' | ||
| - '.github/workflows/fluent_linter.yml' | ||
| - '.github/fluent/*' | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| paths: | ||
| - 'locales/en-US/*.ftl' | ||
| - '.github/workflows/fluent_linter.yml' | ||
| - '.github/fluent/*' | ||
| branches: | ||
| - main | ||
| workflow_dispatch: | ||
| jobs: | ||
| linter: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Clone repository | ||
| uses: actions/checkout@v5 | ||
| - name: Set up Python 3 | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: '3.11' | ||
| cache: 'pip' | ||
|
Comment on lines
+24
to
+28
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From what I understand reading this,
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
We only use one requirement file, unless I missed some Python used elsewhere?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My understanding was that this was used when multiple dependency files are present or they are located in different subdirectories. So to be able to cache, the dependency file has to be in the root directly. Otherwise you need to specify the location since it doesn't look for the sub directories by default. I also see that you can use
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah see another text here:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That is why I had to create a |
||
| cache-dependency-path: '.github/fluent/requirements.txt' | ||
| - name: Install Python dependencies | ||
| run: | | ||
| pip install -r .github/fluent/requirements.txt | ||
| - name: Lint reference | ||
| run: | | ||
| moz-fluent-lint ./locales/en-US --config .github/fluent/linter_config.yml | ||
Uh oh!
There was an error while loading. Please reload this page.