Skip to content

Add reviewdog into PR workflow #114

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

Merged
merged 4 commits into from
May 11, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,45 @@ concurrency:
cancel-in-progress: true

jobs:
reviewdog:
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version-file: .java-version
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Cache konan
uses: actions/cache@v4
with:
path: ~/.konan
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Cache unicode data
uses: actions/cache@v4
with:
path: build/unicode_dump
key: unicode-dump-${{ hashFiles('build/unicode_dump/*') }}
restore-keys: |
unicode-dump-
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: wrapper
- name: Setup reviewdog
uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
- name: Run reviewdog
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: reviewdog -reporter=github-pr-review
check-pr:
uses: ./.github/workflows/build-and-test.yml
with:
Expand Down
13 changes: 13 additions & 0 deletions .reviewdog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
runner:
detekt:
cmd: "./gradlew -q detekt detektAll --console plain"
errorformat: # (optional if you use `format`)
- "%f:%l:%c: %m"
name: detekt
level: error
ktlint:
cmd: "./gradlew ktlintCheck --console plain"
errorformat: # (optional if you use `format`)
- "%f:%l:%c %m"
name: ktlint
level: error
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ internal object ReferenceValidator {
referencesWithPath: Map<RefId, PointerWithBaseId>,
usedRef: Set<ReferenceLocation>,
) {
// TODO: test comment for reviewdog to detekt
val missingRefs: Map<RefId, List<ReferenceLocation>> =
usedRef.asSequence()
.filter { it.refId !in referencesWithPath }
Expand Down
Loading