Skip to content

Commit

Permalink
test(ci): check localization lint + formatting in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mikehardy committed Aug 3, 2024
1 parent f5cc2d3 commit 0f37e0c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ concurrency:
cancel-in-progress: true

jobs:
lintDebug:
name: Lint Debug
lintKotlin:
name: Lint Kotlin
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -55,13 +55,31 @@ jobs:
# "lintVitalFullRelease": if `main` resources are only used in `androidTest` (#15741)
run: ./gradlew lintPlayDebug :api:lintDebug ktLintCheck lintVitalFullRelease lint-rules:test --daemon

lintJavascript:
name: Lint Javascript
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

# Handled under the pre-commit hook: ./gradlew installGitHook

# To run manually, run the following inside folder: Anki-Android
# npm install --location=global prettier
# prettier --check AnkiDroid/**/*.js
- name: Prettify code
- name: Prettify AnkiDroid javascript code
uses: creyD/prettier_action@v4.3
with:
prettier_options: --check AnkiDroid/**/*.js
dry: True

- name: Install Localization
run: cd tools/localization && yarn

- name: Lint Localization
run: cd tools/localization && yarn lint

- name: Format Localization
run: cd tools/localization && yarn checkformat
1 change: 1 addition & 0 deletions tools/localization/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"build": "tsc",
"start": "node ./dist/index.js",
"dev": "tsc --watch",
"checkformat": "npx prettier --check .",
"format": "npx prettier --write .",
"lint": "eslint src/ --max-warnings=0",
"test": "jest --passWithNoTests"
Expand Down

0 comments on commit 0f37e0c

Please sign in to comment.