From 9fc92413d8c2d0965f96dbe7a6901b94c2ef171c Mon Sep 17 00:00:00 2001 From: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Date: Thu, 24 Sep 2026 14:40:01 +0200 Subject: [PATCH] ci: update issue matchers - ktlint/RuboCop need to be run from root to output correct paths - RuboCop now uses built-in GitHub format - Update ktlint problem matcher to include ruleset ids --- .github/ktlint.json | 2 +- .github/minitest.json | 19 ------------------- .github/rubocop.json | 17 ----------------- .github/workflows/build.yml | 14 ++++---------- package.json | 4 +++- packages/app/package.json | 4 ++-- 6 files changed, 10 insertions(+), 50 deletions(-) delete mode 100644 .github/minitest.json delete mode 100644 .github/rubocop.json diff --git a/.github/ktlint.json b/.github/ktlint.json index fd8f7bdee..6bcb2c520 100644 --- a/.github/ktlint.json +++ b/.github/ktlint.json @@ -4,7 +4,7 @@ "owner": "ktlint", "pattern": [ { - "regexp": "(.*?):(\\d+):(\\d+): (.*?) \\(([-\\w]+)\\)$", + "regexp": "^(.*?):(\\d+):(\\d+): (.*?) \\(([\\w:-]+)\\)$", "file": 1, "line": 2, "column": 3, diff --git a/.github/minitest.json b/.github/minitest.json deleted file mode 100644 index 081fbee1c..000000000 --- a/.github/minitest.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "problemMatcher": [ - { - "owner": "minitest", - "pattern": [ - { - "regexp": "^.*?\\[(.*?):(\\d+)\\]:$", - "file": 1, - "line": 2 - }, - { - "regexp": "^\\s*((?:Expected|Actual).*)$", - "message": 1, - "loop": true - } - ] - } - ] -} diff --git a/.github/rubocop.json b/.github/rubocop.json deleted file mode 100644 index 80592ea8d..000000000 --- a/.github/rubocop.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "problemMatcher": [ - { - "owner": "rubocop", - "pattern": [ - { - "regexp": "^(.*?\\.rb):(\\d+):(\\d+):.*?:\\s*(.*?):\\s*(.*)$", - "file": 1, - "line": 2, - "column": 3, - "code": 4, - "message": 5 - } - ] - } - ] -} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b7aed8d6e..e75c4769d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -93,13 +93,8 @@ jobs: - name: CocoaPods if: ${{ runner.os == 'macOS' }} run: | - echo "::add-matcher::.github/rubocop.json" - yarn lint:rb - echo "::remove-matcher owner=rubocop::" - echo "::add-matcher::.github/minitest.json" - yarn test:rb - echo "::remove-matcher owner=minitest::" - working-directory: packages/app + node --run lint:rb -- --format github + yarn workspace react-native-test-app test:rb - name: Populate Gradle cache uses: ./.github/actions/gradle with: @@ -131,14 +126,13 @@ jobs: run: | brew install ktlint echo "::add-matcher::.github/ktlint.json" - yarn lint:kt + node --run lint:kt echo "::remove-matcher owner=ktlint::" - working-directory: packages/app - name: SwiftFormat if: ${{ github.event_name == 'pull_request' && runner.os == 'macOS' }} run: | echo "::add-matcher::.github/swiftformat.json" - yarn format:swift --lint + node --run format:swift -- --lint echo "::remove-matcher owner=swiftformat::" working-directory: packages/app - name: SwiftLint diff --git a/package.json b/package.json index 7eb1b961e..2f946878d 100644 --- a/package.json +++ b/package.json @@ -23,9 +23,11 @@ "scripts": { "format": "nx run-many --target format:c,format:js,format:swift", "format:js": "oxfmt '**/README.md' '**/package.json' '*.{cjs,cts,js,mjs,mts,ts,tsx,yml}' '.github/**/*.json' 'CONTRIBUTING.md' 'nx.json' '!packages/app/package.json'", - "lint": "nx run-many --target lint:js,lint:kt,lint:rb,lint:swift", + "lint": "nx run-many --target lint:js,lint:swift && nx run-many --target lint:kt,lint:rb --projects @microsoft/root", "lint:commit": "git log --format='%s' origin/trunk..HEAD | tail -1 | npx @rnx-kit/commitlint-lite@2.0.0", "lint:js": "oxlint $(git ls-files 'scripts/*.[cm][jt]s' 'scripts/*.[jt]s')", + "lint:kt": "ktlint --relative 'packages/app/android/app/src/**/*.kt'", + "lint:rb": "bundle exec rubocop packages/app", "release-notes": "node scripts/release-notes.ts", "rnx-align-deps": "rnx-align-deps --exclude-packages @microsoft/root,@rnx-kit/react-native-template-web,react-native-test-app", "show-affected": "node scripts/affected.ts" diff --git a/packages/app/package.json b/packages/app/package.json index c42df2155..3acc2965a 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -74,8 +74,8 @@ "generate:docs": "node scripts/internal/generate-manifest-docs.mts", "generate:schema": "node scripts/internal/generate-schema.mts", "lint:js": "oxlint -c ../../oxlint.config.ts $(git ls-files '*.[cm][jt]s' '*.[jt]s' '*.tsx' ':!:*.config.js') && tsc && tsc --project tsconfig.cjs.json", - "lint:kt": "ktlint --relative 'android/app/src/**/*.kt'", - "lint:rb": "bundle exec rubocop", + "lint:kt": "yarn workspace @microsoft/root lint:kt", + "lint:rb": "yarn workspace @microsoft/root lint:rb", "lint:swift": "swiftlint", "prepack": "node scripts/internal/pack.mts pre", "postpack": "node scripts/internal/pack.mts post",