Skip to content

Commit

Permalink
add reviewing step by danger
Browse files Browse the repository at this point in the history
  • Loading branch information
kitakkun committed Apr 6, 2024
1 parent 63e1750 commit 01a4cef
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,21 @@ jobs:

- name: Run JVM tests and Debug Unit Tests
run: ./gradlew allTests

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.2

- name: Install Bundle
run: |
gem install bundler
bundle install
- name: Run Lint
run: ./gradlew ktlintCheck

- name: Run Danger
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bundle exec danger
15 changes: 15 additions & 0 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
github.dismiss_out_of_range_messages

# assign pr author to assignee
if github.pr_json['assignee'] == nil
github.api.add_assignees(
github.pr_json['base']['repo']['full_name'],
github.pr_json['number'],
[github.pr_author]
)
end

checkstyle_format.base_path = Dir.pwd
Dir.glob("build/reports/**/*.xml") do |file|
checkstyle_format.report file
end
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source "https://rubygems.org"

gem "danger"
gem "danger-checkstyle_format"
76 changes: 76 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
base64 (0.2.0)
claide (1.1.0)
claide-plugins (0.9.2)
cork
nap
open4 (~> 1.3)
colored2 (3.1.2)
cork (0.3.0)
colored2 (~> 3.1)
danger (9.4.3)
claide (~> 1.0)
claide-plugins (>= 0.9.2)
colored2 (~> 3.1)
cork (~> 0.1)
faraday (>= 0.9.0, < 3.0)
faraday-http-cache (~> 2.0)
git (~> 1.13)
kramdown (~> 2.3)
kramdown-parser-gfm (~> 1.0)
no_proxy_fix
octokit (>= 4.0)
terminal-table (>= 1, < 4)
danger-checkstyle_format (0.1.1)
danger-plugin-api (~> 1.0)
ox (~> 2.0)
danger-plugin-api (1.0.0)
danger (> 2.0)
faraday (2.9.0)
faraday-net_http (>= 2.0, < 3.2)
faraday-http-cache (2.5.1)
faraday (>= 0.8)
faraday-net_http (3.1.0)
net-http
git (1.19.1)
addressable (~> 2.8)
rchardet (~> 1.8)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
nap (1.1.0)
net-http (0.4.1)
uri
no_proxy_fix (0.1.2)
octokit (8.1.0)
base64
faraday (>= 1, < 3)
sawyer (~> 0.9)
open4 (1.3.4)
ox (2.14.18)
public_suffix (5.0.5)
rchardet (1.8.0)
rexml (3.2.6)
sawyer (0.9.2)
addressable (>= 2.3.5)
faraday (>= 0.17.3, < 3)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
unicode-display_width (2.5.0)
uri (0.13.0)

PLATFORMS
arm64-darwin-23
ruby

DEPENDENCIES
danger
danger-checkstyle_format

BUNDLED WITH
2.5.7
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure
import org.jlleitschuh.gradle.ktlint.KtlintExtension
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType

class LintConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
Expand All @@ -16,6 +17,9 @@ class LintConventionPlugin : Plugin<Project> {
configure<KtlintExtension> {
version.set(libs.findVersion("ktlint").get().requiredVersion)
ignoreFailures.set(true)
reporters {
reporter(ReporterType.CHECKSTYLE)
}
}
}
}
Expand Down

0 comments on commit 01a4cef

Please sign in to comment.