-
Notifications
You must be signed in to change notification settings - Fork 113
101 lines (90 loc) · 2.73 KB
/
linters.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Linters (clang, l10n)
on:
# Triggers the workflow on pull request events but only for the main branch
pull_request:
branches:
- main
- "releases/**"
types:
- opened
- synchronize
- reopened
jobs:
linter:
name: Run Main Linters (clang, l10n, etc.)
runs-on: ubuntu-22.04
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
submodules: "true"
- name: Install dependecies
run: |
sudo apt-get update
sudo apt-get install -y aspell aspell-en $(./scripts/linux/getdeps.py -b linux/debian/control)
- uses: actions/setup-python@v5
with:
python-version: "3.9"
cache: "pip"
- run: pip install -r requirements.txt
- name: Generate updated .ts files and check for l10n errors
run: |
./scripts/utils/generate_ts.sh
python .github/l10n/check_l10n_issues.py
- name: Check for QRC errors
run: |
python scripts/ci/check_qrc.py
- name: Check for addons JSON syntax
run: |
python scripts/ci/check_jsonschema.py addon.json addons/*/manifest.json
- name: Check for issues with clang-format
uses: DoozyX/clang-format-lint-action@v0.16.2
with:
source: "."
clangFormatVersion: 16
style: file
- name: Check for issues with cargo fmt
run: |
for tomlfile in $(git ls-files -c '*/Cargo.toml'); do
(cd $(dirname $tomlfile) && cargo fmt --check) || true
done
- name: Spell check documentation files
run: |
scripts/utils/spellcheck.sh list
- name: Check for missing language names in extras.xliff
run: |
scripts/ci/check_lang_names.py
ktlint:
name: Run ktLint
runs-on: ubuntu-latest
defaults:
run:
# This allows us to use conda
shell: bash -el {0}
steps:
- name: Clone repo
uses: actions/checkout@master
with:
fetch-depth: 1
- name: Cache conda Packages
uses: actions/cache@v4
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-packages
# Glean is required for the gradle build.
- name: Fetch glean submodules
run: |
git submodule update --init 3rdparty/glean
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: vpn
environment-file: env.yml
- name: Setup Android SDK
run: |
conda info
./scripts/android/conda_setup_sdk.sh
- name: Run ktlint
working-directory: android
run: |
conda info
REPOSITORY_ROOT=$(pwd)/.. ./gradlew ktlint