danger-space_checkstyle_reports 1.0.1 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/gem-push.yml +49 -0
- data/Dangerfile.sample +3 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +147 -0
- data/Guardfile +21 -0
- data/LICENSE.txt +22 -0
- data/README.md +30 -0
- data/Rakefile +25 -0
- data/danger-checkstyle_reports.gemspec +50 -0
- data/lib/{space_checkstyle_reports → checkstyle_reports}/entity/found_error.rb +1 -1
- data/lib/{space_checkstyle_reports → checkstyle_reports}/entity/found_file.rb +1 -1
- data/lib/checkstyle_reports/gem_version.rb +5 -0
- data/lib/{space_checkstyle_reports → checkstyle_reports}/lib/severity.rb +2 -2
- data/lib/checkstyle_reports/plugin.rb +179 -0
- data/lib/danger_checkstyle_reports.rb +3 -0
- data/lib/danger_plugin.rb +3 -0
- data/spec/checkstyle_reports_spec.rb +26 -0
- data/spec/entity/found_error_spec.rb +2 -2
- data/spec/entity/found_file_spec.rb +12 -12
- data/spec/lib/severity_spec.rb +3 -3
- data/spec/spec_helper.rb +71 -0
- metadata +33 -17
- data/fixture/github_pr.json +0 -333
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1d4bae6985dc8c897086f29ad9355069a19f55c0a96400495aaa223f5271f0d
|
4
|
+
data.tar.gz: 7a9ced186b2e55dbbdcbb79126356781cae146142cdadac23569ba32a614f5ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d649fd20a8da7527d2551f36339b7771b3e1665c13ccaf80e0a657b5fdd2fc9ce055e2a1718d46cc3e8c7785b1022278f05278033f70872eb7a7e731477cfcb9
|
7
|
+
data.tar.gz: a23b1a323342b1711ad3b9de0915a4932193f0492eb542e55710818394899815e53a81b449db9f8b29c385bd9c1b2684a2f819eaa86537a379eb2afa306aa911
|
@@ -0,0 +1,49 @@
|
|
1
|
+
name: Ruby Gem
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ "master" ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ "master" ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
build:
|
11
|
+
name: Build + Publish
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
permissions:
|
14
|
+
contents: read
|
15
|
+
packages: write
|
16
|
+
|
17
|
+
steps:
|
18
|
+
- uses: actions/checkout@v3
|
19
|
+
- name: Set up Ruby 2.6
|
20
|
+
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
21
|
+
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
22
|
+
# uses: ruby/setup-ruby@v1
|
23
|
+
uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
|
24
|
+
with:
|
25
|
+
ruby-version: head
|
26
|
+
|
27
|
+
# Currently we don't use GPR, if it will be needed in the future, just uncomment this
|
28
|
+
# - name: Publish to GPR
|
29
|
+
# run: |
|
30
|
+
# mkdir -p $HOME/.gem
|
31
|
+
# touch $HOME/.gem/credentials
|
32
|
+
# chmod 0600 $HOME/.gem/credentials
|
33
|
+
# printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
34
|
+
# gem build *.gemspec
|
35
|
+
# gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
|
36
|
+
# env:
|
37
|
+
# GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
|
38
|
+
# OWNER: ${{ github.repository_owner }}
|
39
|
+
|
40
|
+
- name: Publish to RubyGems
|
41
|
+
run: |
|
42
|
+
mkdir -p $HOME/.gem
|
43
|
+
touch $HOME/.gem/credentials
|
44
|
+
chmod 0600 $HOME/.gem/credentials
|
45
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
46
|
+
gem build *.gemspec
|
47
|
+
gem push *.gem
|
48
|
+
env:
|
49
|
+
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
|
data/Dangerfile.sample
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,147 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
danger-space_checkstyle_reports (0.0.1)
|
5
|
+
danger-plugin-api (~> 1.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
addressable (2.8.4)
|
11
|
+
public_suffix (>= 2.0.2, < 6.0)
|
12
|
+
ast (2.4.0)
|
13
|
+
claide (1.1.0)
|
14
|
+
claide-plugins (0.9.2)
|
15
|
+
cork
|
16
|
+
nap
|
17
|
+
open4 (~> 1.3)
|
18
|
+
coderay (1.1.2)
|
19
|
+
colored2 (3.1.2)
|
20
|
+
cork (0.3.0)
|
21
|
+
colored2 (~> 3.1)
|
22
|
+
danger (9.3.0)
|
23
|
+
claide (~> 1.0)
|
24
|
+
claide-plugins (>= 0.9.2)
|
25
|
+
colored2 (~> 3.1)
|
26
|
+
cork (~> 0.1)
|
27
|
+
faraday (>= 0.9.0, < 3.0)
|
28
|
+
faraday-http-cache (~> 2.0)
|
29
|
+
git (~> 1.13.0)
|
30
|
+
kramdown (~> 2.3)
|
31
|
+
kramdown-parser-gfm (~> 1.0)
|
32
|
+
no_proxy_fix
|
33
|
+
octokit (~> 5.0)
|
34
|
+
terminal-table (>= 1, < 4)
|
35
|
+
danger-plugin-api (1.0.0)
|
36
|
+
danger (> 2.0)
|
37
|
+
diff-lcs (1.3)
|
38
|
+
faraday (2.7.4)
|
39
|
+
faraday-net_http (>= 2.0, < 3.1)
|
40
|
+
ruby2_keywords (>= 0.0.4)
|
41
|
+
faraday-http-cache (2.5.0)
|
42
|
+
faraday (>= 0.8)
|
43
|
+
faraday-net_http (3.0.2)
|
44
|
+
ffi (1.9.25)
|
45
|
+
formatador (0.2.5)
|
46
|
+
git (1.13.2)
|
47
|
+
addressable (~> 2.8)
|
48
|
+
rchardet (~> 1.8)
|
49
|
+
guard (2.14.2)
|
50
|
+
formatador (>= 0.2.4)
|
51
|
+
listen (>= 2.7, < 4.0)
|
52
|
+
lumberjack (>= 1.0.12, < 2.0)
|
53
|
+
nenv (~> 0.1)
|
54
|
+
notiffany (~> 0.0)
|
55
|
+
pry (>= 0.9.12)
|
56
|
+
shellany (~> 0.0)
|
57
|
+
thor (>= 0.18.1)
|
58
|
+
guard-compat (1.2.1)
|
59
|
+
guard-rspec (4.7.3)
|
60
|
+
guard (~> 2.1)
|
61
|
+
guard-compat (~> 1.1)
|
62
|
+
rspec (>= 2.99.0, < 4.0)
|
63
|
+
jaro_winkler (1.5.1)
|
64
|
+
kramdown (2.4.0)
|
65
|
+
rexml
|
66
|
+
kramdown-parser-gfm (1.1.0)
|
67
|
+
kramdown (~> 2.0)
|
68
|
+
listen (3.0.7)
|
69
|
+
rb-fsevent (>= 0.9.3)
|
70
|
+
rb-inotify (>= 0.9.7)
|
71
|
+
lumberjack (1.0.13)
|
72
|
+
method_source (0.9.0)
|
73
|
+
nap (1.1.0)
|
74
|
+
nenv (0.3.0)
|
75
|
+
no_proxy_fix (0.1.2)
|
76
|
+
notiffany (0.1.1)
|
77
|
+
nenv (~> 0.1)
|
78
|
+
shellany (~> 0.0)
|
79
|
+
octokit (5.6.1)
|
80
|
+
faraday (>= 1, < 3)
|
81
|
+
sawyer (~> 0.9)
|
82
|
+
open4 (1.3.4)
|
83
|
+
parallel (1.12.1)
|
84
|
+
parser (2.5.1.2)
|
85
|
+
ast (~> 2.4.0)
|
86
|
+
powerpack (0.1.2)
|
87
|
+
pry (0.11.3)
|
88
|
+
coderay (~> 1.1.0)
|
89
|
+
method_source (~> 0.9.0)
|
90
|
+
public_suffix (5.0.1)
|
91
|
+
rainbow (3.0.0)
|
92
|
+
rake (13.0.6)
|
93
|
+
rb-fsevent (0.10.3)
|
94
|
+
rb-inotify (0.9.10)
|
95
|
+
ffi (>= 0.5.0, < 2)
|
96
|
+
rchardet (1.8.0)
|
97
|
+
rexml (3.2.5)
|
98
|
+
rspec (3.7.0)
|
99
|
+
rspec-core (~> 3.7.0)
|
100
|
+
rspec-expectations (~> 3.7.0)
|
101
|
+
rspec-mocks (~> 3.7.0)
|
102
|
+
rspec-core (3.7.1)
|
103
|
+
rspec-support (~> 3.7.0)
|
104
|
+
rspec-expectations (3.7.0)
|
105
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
106
|
+
rspec-support (~> 3.7.0)
|
107
|
+
rspec-mocks (3.7.0)
|
108
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
109
|
+
rspec-support (~> 3.7.0)
|
110
|
+
rspec-support (3.7.1)
|
111
|
+
rubocop (0.58.2)
|
112
|
+
jaro_winkler (~> 1.5.1)
|
113
|
+
parallel (~> 1.10)
|
114
|
+
parser (>= 2.5, != 2.5.1.1)
|
115
|
+
powerpack (~> 0.1)
|
116
|
+
rainbow (>= 2.2.2, < 4.0)
|
117
|
+
ruby-progressbar (~> 1.7)
|
118
|
+
unicode-display_width (~> 1.0, >= 1.0.1)
|
119
|
+
ruby-progressbar (1.9.0)
|
120
|
+
ruby2_keywords (0.0.5)
|
121
|
+
sawyer (0.9.2)
|
122
|
+
addressable (>= 2.3.5)
|
123
|
+
faraday (>= 0.17.3, < 3)
|
124
|
+
shellany (0.0.1)
|
125
|
+
terminal-table (3.0.2)
|
126
|
+
unicode-display_width (>= 1.1.1, < 3)
|
127
|
+
thor (0.20.0)
|
128
|
+
unicode-display_width (1.4.0)
|
129
|
+
yard (0.9.34)
|
130
|
+
|
131
|
+
PLATFORMS
|
132
|
+
ruby
|
133
|
+
|
134
|
+
DEPENDENCIES
|
135
|
+
bundler (~> 1.3)
|
136
|
+
danger-space_checkstyle_reports!
|
137
|
+
guard (~> 2.14)
|
138
|
+
guard-rspec (~> 4.7)
|
139
|
+
listen (= 3.0.7)
|
140
|
+
pry
|
141
|
+
rake (~> 13.0)
|
142
|
+
rspec (~> 3.4)
|
143
|
+
rubocop
|
144
|
+
yard
|
145
|
+
|
146
|
+
BUNDLED WITH
|
147
|
+
1.16.3
|
data/Guardfile
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# A guardfile for making Danger Plugins
|
4
|
+
# For more info see https://github.com/guard/guard#readme
|
5
|
+
|
6
|
+
# To run, use `bundle exec guard`.
|
7
|
+
|
8
|
+
guard :rspec, cmd: "bundle exec rspec" do
|
9
|
+
require "guard/rspec/dsl"
|
10
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
11
|
+
|
12
|
+
# RSpec files
|
13
|
+
rspec = dsl.rspec
|
14
|
+
watch(rspec.spec_helper) { rspec.spec_dir }
|
15
|
+
watch(rspec.spec_support) { rspec.spec_dir }
|
16
|
+
watch(rspec.spec_files)
|
17
|
+
|
18
|
+
# Ruby files
|
19
|
+
ruby = dsl.ruby
|
20
|
+
dsl.watch_spec_files_for(ruby.lib_files)
|
21
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2018 Jumpei Matsuda <jmatsu.drm@gmail.com>
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# Danger Space Checkstyle Reports
|
2
|
+
|
3
|
+
This is a plugin of [Danger](https://github.com/danger/danger) for Android projects.
|
4
|
+
This reports checkstyle results.
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
`gem install danger-space_checkstyle_reports`
|
9
|
+
|
10
|
+
## Usage
|
11
|
+
|
12
|
+
`checkstyle_reports` namespace is available under Dangerfile.
|
13
|
+
|
14
|
+
### Report errors
|
15
|
+
|
16
|
+
```
|
17
|
+
# If you'd like inlining comments
|
18
|
+
checkstyle_reports.inline_comment = true
|
19
|
+
# If you want to filter only modified lines
|
20
|
+
checkstyle_reports.filtering_lines = true
|
21
|
+
checkstyle_reports.report(/path/to/xml)
|
22
|
+
```
|
23
|
+
|
24
|
+
## Development
|
25
|
+
|
26
|
+
1. Clone this repo
|
27
|
+
2. Run `bundle install` to setup dependencies.
|
28
|
+
3. Run `bundle exec rake spec` to run the tests.
|
29
|
+
4. Use `bundle exec guard` to automatically have tests run as you make changes.
|
30
|
+
5. Make your changes.
|
data/Rakefile
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
require "rspec/core/rake_task"
|
5
|
+
require "rubocop/rake_task"
|
6
|
+
|
7
|
+
RSpec::Core::RakeTask.new(:specs)
|
8
|
+
|
9
|
+
task default: :specs
|
10
|
+
|
11
|
+
task :spec do
|
12
|
+
Rake::Task["specs"].invoke
|
13
|
+
Rake::Task["rubocop"].invoke
|
14
|
+
Rake::Task["spec_docs"].invoke
|
15
|
+
end
|
16
|
+
|
17
|
+
desc "Run RuboCop on the lib/specs directory"
|
18
|
+
RuboCop::RakeTask.new(:rubocop) do |task|
|
19
|
+
task.patterns = ["lib/**/*.rb", "spec/**/*.rb"]
|
20
|
+
end
|
21
|
+
|
22
|
+
desc "Ensure that the plugin passes `danger plugins lint`"
|
23
|
+
task :spec_docs do
|
24
|
+
sh "bundle exec danger plugins lint"
|
25
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path("lib", __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require "checkstyle_reports/gem_version.rb"
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = "danger-space_checkstyle_reports"
|
9
|
+
spec.version = CheckstyleReports::VERSION
|
10
|
+
spec.authors = ["Tedo Manvelidze"]
|
11
|
+
spec.email = ["tedex.manvelidze@gmail.com"]
|
12
|
+
spec.description = "To report checkstyle results via danger."
|
13
|
+
spec.summary = "This is a danger plugin to report checkstyle results with line filtering."
|
14
|
+
spec.homepage = "https://github.com/SpaceBank/Android-Space-Danger-Checkstyle-Reports"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files | grep -v 'fixture/'`.split($/)
|
18
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.add_runtime_dependency "danger-plugin-api", "~> 1.0"
|
23
|
+
|
24
|
+
# General ruby development
|
25
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
26
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
27
|
+
|
28
|
+
# Testing support
|
29
|
+
spec.add_development_dependency "rspec", "~> 3.4"
|
30
|
+
|
31
|
+
# Linting code and docs
|
32
|
+
spec.add_development_dependency "rubocop"
|
33
|
+
spec.add_development_dependency "yard"
|
34
|
+
|
35
|
+
# Makes testing easy via `bundle exec guard`
|
36
|
+
spec.add_development_dependency "guard", "~> 2.14"
|
37
|
+
spec.add_development_dependency "guard-rspec", "~> 4.7"
|
38
|
+
|
39
|
+
# If you want to work on older builds of ruby
|
40
|
+
spec.add_development_dependency "listen", "3.0.7"
|
41
|
+
|
42
|
+
# This gives you the chance to run a REPL inside your tests
|
43
|
+
# via:
|
44
|
+
#
|
45
|
+
# require 'pry'
|
46
|
+
# binding.pry
|
47
|
+
#
|
48
|
+
# This will stop test execution and let you inspect the results
|
49
|
+
spec.add_development_dependency "pry"
|
50
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
module
|
3
|
+
module CheckstyleReports
|
4
4
|
class Severity
|
5
5
|
VALUES = %i(ignore info warning error).freeze
|
6
6
|
|
@@ -15,4 +15,4 @@ module SpaceCheckstyleReports
|
|
15
15
|
VALUES.index(@base) <= VALUES.index(other.to_sym)
|
16
16
|
end
|
17
17
|
end
|
18
|
-
end
|
18
|
+
end
|
@@ -0,0 +1,179 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'pathname'
|
4
|
+
require 'rexml/document'
|
5
|
+
|
6
|
+
require_relative 'gem_version'
|
7
|
+
|
8
|
+
require_relative 'lib/severity'
|
9
|
+
|
10
|
+
require_relative 'entity/found_error'
|
11
|
+
require_relative 'entity/found_file'
|
12
|
+
|
13
|
+
module Danger
|
14
|
+
# Comment checkstyle reports.
|
15
|
+
#
|
16
|
+
# You need to specify the project root. You don't need do it if it is same with git's top-level path.
|
17
|
+
#
|
18
|
+
# checkstyle_reports.root_path=/path/to/project
|
19
|
+
#
|
20
|
+
# @example Report errors whose files have been modified (By default)
|
21
|
+
#
|
22
|
+
# checkstyle_reports.report("app/build/checkstyle/checkstyle.xml"[, modified_files_only: true])
|
23
|
+
#
|
24
|
+
# @example Report all errors in app/build/checkstyle/checkstyle.xml
|
25
|
+
#
|
26
|
+
# checkstyle_reports.report("app/build/checkstyle/checkstyle.xml", modified_files_only: false)
|
27
|
+
#
|
28
|
+
# @tags android, checkstyle
|
29
|
+
#
|
30
|
+
class DangerCheckstyleReports < Plugin
|
31
|
+
REPORT_METHODS = %i[message warn fail].freeze
|
32
|
+
|
33
|
+
# *Optional*
|
34
|
+
# An absolute path to a root.
|
35
|
+
# To comment errors to VCS, this needs to know relative path of files from the root.
|
36
|
+
#
|
37
|
+
# @return [String] the root path of git repository by default.
|
38
|
+
attr_accessor :root_path
|
39
|
+
|
40
|
+
# *Optional*
|
41
|
+
# Create inline comment if true.
|
42
|
+
#
|
43
|
+
# @return [Boolean] true by default
|
44
|
+
attr_accessor :inline_comment
|
45
|
+
|
46
|
+
# *Optional*
|
47
|
+
# minimum severity to be reported (inclusive)
|
48
|
+
#
|
49
|
+
# @return [String, Symbol] error by default
|
50
|
+
attr_accessor :min_severity
|
51
|
+
|
52
|
+
# *Optional*
|
53
|
+
# Set report method
|
54
|
+
#
|
55
|
+
# @return [String, Symbol] error by default
|
56
|
+
attr_accessor :report_method
|
57
|
+
|
58
|
+
# Enable filtering
|
59
|
+
# Only show messages within changed files.
|
60
|
+
attr_accessor :filtering
|
61
|
+
|
62
|
+
# Only show messages for the modified lines.
|
63
|
+
attr_accessor :filtering_lines
|
64
|
+
|
65
|
+
# The array of files which include at least one error
|
66
|
+
#
|
67
|
+
# @return [Array<String>] a collection of relative paths
|
68
|
+
attr_reader :reported_files
|
69
|
+
|
70
|
+
# Report errors based on the given xml file if needed
|
71
|
+
#
|
72
|
+
# @param [String] xml_file which contains checkstyle results to be reported
|
73
|
+
# @param [Boolean] modified_files_only which is a flag to filter out non-added/non-modified files
|
74
|
+
# @return [void] void
|
75
|
+
def report(xml_file, modified_files_only: true)
|
76
|
+
raise 'File path must not be empty' if xml_file.empty?
|
77
|
+
raise 'File not found' unless File.exist?(xml_file)
|
78
|
+
|
79
|
+
@min_severity = (min_severity || :error).to_sym
|
80
|
+
@report_method = (report_method || :fail).to_sym
|
81
|
+
|
82
|
+
raise 'Unknown severity found' unless CheckstyleReports::Severity::VALUES.include?(min_severity)
|
83
|
+
raise 'Unknown report method' unless REPORT_METHODS.include?(report_method)
|
84
|
+
|
85
|
+
files = parse_xml(xml_file, modified_files_only)
|
86
|
+
|
87
|
+
@reported_files = files.map(&:relative_path)
|
88
|
+
|
89
|
+
do_comment(files) unless files.empty?
|
90
|
+
end
|
91
|
+
|
92
|
+
private
|
93
|
+
|
94
|
+
# Parse the given xml file and apply filters if needed
|
95
|
+
#
|
96
|
+
# @param [String] file_path which is a check-style xml file
|
97
|
+
# @param [Boolean] modified_files_only a flag to determine to apply added/modified files-only filter
|
98
|
+
# @return [Array<FoundFile>] filtered files
|
99
|
+
def parse_xml(file_path, modified_files_only)
|
100
|
+
prefix = root_path || `git rev-parse --show-toplevel`.chomp
|
101
|
+
|
102
|
+
files = []
|
103
|
+
|
104
|
+
REXML::Document.new(File.read(file_path)).root.elements.each("file") do |f|
|
105
|
+
files << CheckstyleReports::Entity::FoundFile.new(f, prefix: prefix)
|
106
|
+
end
|
107
|
+
|
108
|
+
if modified_files_only
|
109
|
+
target_files = git.modified_files + git.added_files
|
110
|
+
|
111
|
+
files.select! { |f| target_files.include?(f.relative_path) }
|
112
|
+
end
|
113
|
+
|
114
|
+
files.reject! { |f| f.errors.empty? }
|
115
|
+
files
|
116
|
+
end
|
117
|
+
|
118
|
+
# Comment errors based on the given xml file to VCS
|
119
|
+
#
|
120
|
+
# @param [Array<FoundFile>] files which contains checkstyle results to be reported
|
121
|
+
# @return [void] void
|
122
|
+
def do_comment(files)
|
123
|
+
base_severity = CheckstyleReports::Severity.new(min_severity)
|
124
|
+
target_files = git.modified_files + git.added_files
|
125
|
+
target_lines = {}
|
126
|
+
|
127
|
+
if filtering_lines
|
128
|
+
target_files.each do |file|
|
129
|
+
added_lines = parse_added_line_numbers(git.diff[file].patch)
|
130
|
+
target_lines[file] = added_lines
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
files.each do |f|
|
135
|
+
f.errors.each do |e|
|
136
|
+
# check severity
|
137
|
+
next unless base_severity <= e.severity
|
138
|
+
|
139
|
+
if filtering_lines
|
140
|
+
next unless target_files.include?(f.relative_path)
|
141
|
+
added_lines = target_lines[f.relative_path]
|
142
|
+
next unless added_lines.include?(e.line_number)
|
143
|
+
end
|
144
|
+
|
145
|
+
if inline_comment
|
146
|
+
public_send(report_method, e.html_unescaped_message, file: f.relative_path, line: e.line_number)
|
147
|
+
else
|
148
|
+
public_send(report_method, "#{f.relative_path} : #{e.html_unescaped_message} at #{e.line_number}")
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
# Parses git diff of a file and returns an array of added line numbers.
|
155
|
+
def parse_added_line_numbers(diff)
|
156
|
+
current_line_number = nil
|
157
|
+
added_line_numbers = []
|
158
|
+
diff_lines = diff.strip.split("\n")
|
159
|
+
diff_lines.each_with_index do |line, index|
|
160
|
+
if (m = %r{\+(\d+)(?:,\d+)? @@}.match(line))
|
161
|
+
# (e.g. @@ -32,10 +32,7 @@)
|
162
|
+
current_line_number = Integer(m[1])
|
163
|
+
else
|
164
|
+
if !current_line_number.nil?
|
165
|
+
if line.start_with?('+')
|
166
|
+
# added line
|
167
|
+
added_line_numbers.push(current_line_number)
|
168
|
+
current_line_number += 1
|
169
|
+
elsif !line.start_with?('-')
|
170
|
+
# unmodified line
|
171
|
+
current_line_number += 1
|
172
|
+
end
|
173
|
+
end
|
174
|
+
end
|
175
|
+
end
|
176
|
+
added_line_numbers
|
177
|
+
end
|
178
|
+
end
|
179
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require File.expand_path("spec_helper", __dir__)
|
4
|
+
|
5
|
+
module Danger
|
6
|
+
describe Danger::DangerCheckstyleReports do
|
7
|
+
it "should be a plugin" do
|
8
|
+
expect(Danger::DangerCheckstyleReports.new(nil)).to be_a Danger::Plugin
|
9
|
+
end
|
10
|
+
|
11
|
+
#
|
12
|
+
# You should test your custom attributes and methods here
|
13
|
+
#
|
14
|
+
describe "with Dangerfile" do
|
15
|
+
before do
|
16
|
+
@dangerfile = testing_dangerfile
|
17
|
+
@my_plugin = @dangerfile.checkstyle_reports
|
18
|
+
|
19
|
+
# mock the PR data
|
20
|
+
# you can then use this, eg. github.pr_author, later in the spec
|
21
|
+
json = File.read(fixture_path + "github_pr.json")
|
22
|
+
allow(@my_plugin.github).to receive(:pr_json).and_return(json)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require_relative "../spec_helper"
|
4
4
|
|
5
|
-
module
|
5
|
+
module CheckstyleReports::Entity
|
6
6
|
ERROR_NODE_SAMPLE_1 = <<NODE
|
7
7
|
<error
|
8
8
|
line="144"
|
@@ -22,7 +22,7 @@ NODE
|
|
22
22
|
/>
|
23
23
|
NODE
|
24
24
|
|
25
|
-
describe
|
25
|
+
describe CheckstyleReports::Entity::FoundError do
|
26
26
|
let(:error) { FoundError.new(REXML::Document.new(node).root) }
|
27
27
|
|
28
28
|
context "sample1" do
|
@@ -2,17 +2,17 @@
|
|
2
2
|
|
3
3
|
require_relative "../spec_helper"
|
4
4
|
|
5
|
-
module
|
5
|
+
module CheckstyleReports::Entity
|
6
6
|
FILE_NODE_SAMPLE_1 = <<NODE
|
7
7
|
<file
|
8
|
-
name="/Users/
|
8
|
+
name="/Users/jmatsu/Workspace/sample/src/main/java/io/github/jmatsu/Sample.java" >
|
9
9
|
#{ERROR_NODE_SAMPLE_1}
|
10
10
|
</file>
|
11
11
|
NODE
|
12
12
|
|
13
13
|
FILE_NODE_SAMPLE_2 = <<NODE
|
14
14
|
<file
|
15
|
-
name="/Users/
|
15
|
+
name="/Users/jmatsu/Workspace/sample/src/test/java/io/github/jmatsu/Sample2.java" >
|
16
16
|
#{ERROR_NODE_SAMPLE_1}
|
17
17
|
#{ERROR_NODE_SAMPLE_2}
|
18
18
|
</file>
|
@@ -20,19 +20,19 @@ NODE
|
|
20
20
|
|
21
21
|
FILE_NODE_SAMPLE_EMPTY = <<NODE
|
22
22
|
<file
|
23
|
-
name="/Users/
|
23
|
+
name="/Users/jmatsu/Workspace/sample/src/main/java/io/github/jmatsu/Sample.java" />
|
24
24
|
NODE
|
25
25
|
|
26
|
-
describe
|
27
|
-
let(:file) { FoundFile.new(REXML::Document.new(node).root, prefix: "/Users/
|
26
|
+
describe CheckstyleReports::Entity::FoundFile do
|
27
|
+
let(:file) { FoundFile.new(REXML::Document.new(node).root, prefix: "/Users/jmatsu/Workspace/sample") }
|
28
28
|
|
29
29
|
context "sample1" do
|
30
30
|
let(:node) { FILE_NODE_SAMPLE_1 }
|
31
31
|
|
32
32
|
it "should read it successfully" do
|
33
|
-
expect(file.path).to eq("/Users/
|
33
|
+
expect(file.path).to eq("/Users/jmatsu/Workspace/sample/src/main/java/io/github/jmatsu/Sample.java")
|
34
34
|
expect(file.errors.size).to eq(1)
|
35
|
-
expect(file.relative_path).to eq("src/main/java/io/github/
|
35
|
+
expect(file.relative_path).to eq("src/main/java/io/github/jmatsu/Sample.java")
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
@@ -40,9 +40,9 @@ NODE
|
|
40
40
|
let(:node) { FILE_NODE_SAMPLE_2 }
|
41
41
|
|
42
42
|
it "should read it successfully" do
|
43
|
-
expect(file.path).to eq("/Users/
|
43
|
+
expect(file.path).to eq("/Users/jmatsu/Workspace/sample/src/test/java/io/github/jmatsu/Sample2.java")
|
44
44
|
expect(file.errors.size).to eq(2)
|
45
|
-
expect(file.relative_path).to eq("src/test/java/io/github/
|
45
|
+
expect(file.relative_path).to eq("src/test/java/io/github/jmatsu/Sample2.java")
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
@@ -50,9 +50,9 @@ NODE
|
|
50
50
|
let(:node) { FILE_NODE_SAMPLE_EMPTY }
|
51
51
|
|
52
52
|
it "should read it successfully" do
|
53
|
-
expect(file.path).to eq("/Users/
|
53
|
+
expect(file.path).to eq("/Users/jmatsu/Workspace/sample/src/main/java/io/github/jmatsu/Sample.java")
|
54
54
|
expect(file.errors.size).to eq(0)
|
55
|
-
expect(file.relative_path).to eq("src/main/java/io/github/
|
55
|
+
expect(file.relative_path).to eq("src/main/java/io/github/jmatsu/Sample.java")
|
56
56
|
end
|
57
57
|
end
|
58
58
|
end
|
data/spec/lib/severity_spec.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
require_relative "../spec_helper"
|
4
4
|
|
5
|
-
module
|
6
|
-
describe
|
5
|
+
module CheckstyleReports
|
6
|
+
describe CheckstyleReports::Severity do
|
7
7
|
let(:data) do
|
8
8
|
[
|
9
9
|
[:ignore, :ignore, true],
|
@@ -30,7 +30,7 @@ module SpaceCheckstyleReports
|
|
30
30
|
data.each do |d|
|
31
31
|
base, other, expected = d
|
32
32
|
|
33
|
-
severity =
|
33
|
+
severity = CheckstyleReports::Severity.new(base)
|
34
34
|
|
35
35
|
expect(severity <= other).to eq(expected)
|
36
36
|
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "pathname"
|
4
|
+
ROOT = Pathname.new(File.expand_path("..", __dir__))
|
5
|
+
$:.unshift((ROOT + "lib").to_s)
|
6
|
+
$:.unshift((ROOT + "spec").to_s)
|
7
|
+
|
8
|
+
def fixture_path
|
9
|
+
"#{(ROOT + 'fixture')}/"
|
10
|
+
end
|
11
|
+
|
12
|
+
require "bundler/setup"
|
13
|
+
require "pry"
|
14
|
+
|
15
|
+
require "rspec"
|
16
|
+
require "danger"
|
17
|
+
|
18
|
+
if `git remote -v` == ""
|
19
|
+
puts "You cannot run tests without setting a local git remote on this repo"
|
20
|
+
puts "It's a weird side-effect of Danger's internals."
|
21
|
+
exit(0)
|
22
|
+
end
|
23
|
+
|
24
|
+
# Use coloured output, it's the best.
|
25
|
+
RSpec.configure do |config|
|
26
|
+
config.filter_gems_from_backtrace "bundler"
|
27
|
+
config.color = true
|
28
|
+
config.tty = true
|
29
|
+
end
|
30
|
+
|
31
|
+
require "danger_plugin"
|
32
|
+
|
33
|
+
# These functions are a subset of https://github.com/danger/danger/blob/master/spec/spec_helper.rb
|
34
|
+
# If you are expanding these files, see if it's already been done ^.
|
35
|
+
|
36
|
+
# A silent version of the user interface,
|
37
|
+
# it comes with an extra function `.string` which will
|
38
|
+
# strip all ANSI colours from the string.
|
39
|
+
|
40
|
+
# rubocop:disable Lint/NestedMethodDefinition
|
41
|
+
def testing_ui
|
42
|
+
@output = StringIO.new
|
43
|
+
def @output.winsize
|
44
|
+
[20, 9999]
|
45
|
+
end
|
46
|
+
|
47
|
+
cork = Cork::Board.new(out: @output)
|
48
|
+
def cork.string
|
49
|
+
out.string.gsub(/\e\[([;\d]+)?m/, "")
|
50
|
+
end
|
51
|
+
cork
|
52
|
+
end
|
53
|
+
# rubocop:enable Lint/NestedMethodDefinition
|
54
|
+
|
55
|
+
# Example environment (ENV) that would come from
|
56
|
+
# running a PR on TravisCI
|
57
|
+
def testing_env
|
58
|
+
{
|
59
|
+
"HAS_JOSH_K_SEAL_OF_APPROVAL" => "true",
|
60
|
+
"TRAVIS_PULL_REQUEST" => "800",
|
61
|
+
"TRAVIS_REPO_SLUG" => "artsy/eigen",
|
62
|
+
"TRAVIS_COMMIT_RANGE" => "759adcbd0d8f...13c4dc8bb61d",
|
63
|
+
"DANGER_GITHUB_API_TOKEN" => "123sbdq54erfsd3422gdfio"
|
64
|
+
}
|
65
|
+
end
|
66
|
+
|
67
|
+
# A stubbed out Dangerfile for use in tests
|
68
|
+
def testing_dangerfile
|
69
|
+
env = Danger::EnvironmentManager.new(testing_env)
|
70
|
+
Danger::Dangerfile.new(env, testing_ui)
|
71
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danger-space_checkstyle_reports
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tedo Manvelidze
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: danger-plugin-api
|
@@ -30,28 +30,28 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '1.3'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '1.3'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '13.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '13.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,27 +150,41 @@ dependencies:
|
|
150
150
|
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
|
-
description:
|
153
|
+
description: To report checkstyle results via danger.
|
154
154
|
email:
|
155
|
-
-
|
155
|
+
- tedex.manvelidze@gmail.com
|
156
156
|
executables: []
|
157
157
|
extensions: []
|
158
158
|
extra_rdoc_files: []
|
159
159
|
files:
|
160
|
+
- ".github/workflows/gem-push.yml"
|
160
161
|
- ".gitignore"
|
162
|
+
- Dangerfile.sample
|
163
|
+
- Gemfile
|
164
|
+
- Gemfile.lock
|
165
|
+
- Guardfile
|
161
166
|
- LICENSE
|
162
|
-
-
|
163
|
-
-
|
164
|
-
-
|
165
|
-
-
|
167
|
+
- LICENSE.txt
|
168
|
+
- README.md
|
169
|
+
- Rakefile
|
170
|
+
- danger-checkstyle_reports.gemspec
|
171
|
+
- lib/checkstyle_reports/entity/found_error.rb
|
172
|
+
- lib/checkstyle_reports/entity/found_file.rb
|
173
|
+
- lib/checkstyle_reports/gem_version.rb
|
174
|
+
- lib/checkstyle_reports/lib/severity.rb
|
175
|
+
- lib/checkstyle_reports/plugin.rb
|
176
|
+
- lib/danger_checkstyle_reports.rb
|
177
|
+
- lib/danger_plugin.rb
|
178
|
+
- spec/checkstyle_reports_spec.rb
|
166
179
|
- spec/entity/found_error_spec.rb
|
167
180
|
- spec/entity/found_file_spec.rb
|
168
181
|
- spec/lib/severity_spec.rb
|
182
|
+
- spec/spec_helper.rb
|
169
183
|
homepage: https://github.com/SpaceBank/Android-Space-Danger-Checkstyle-Reports
|
170
184
|
licenses:
|
171
185
|
- MIT
|
172
186
|
metadata: {}
|
173
|
-
post_install_message:
|
187
|
+
post_install_message:
|
174
188
|
rdoc_options: []
|
175
189
|
require_paths:
|
176
190
|
- lib
|
@@ -185,11 +199,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
185
199
|
- !ruby/object:Gem::Version
|
186
200
|
version: '0'
|
187
201
|
requirements: []
|
188
|
-
rubygems_version: 3.
|
189
|
-
signing_key:
|
202
|
+
rubygems_version: 3.5.0.dev
|
203
|
+
signing_key:
|
190
204
|
specification_version: 4
|
191
|
-
summary:
|
205
|
+
summary: This is a danger plugin to report checkstyle results with line filtering.
|
192
206
|
test_files:
|
207
|
+
- spec/checkstyle_reports_spec.rb
|
193
208
|
- spec/entity/found_error_spec.rb
|
194
209
|
- spec/entity/found_file_spec.rb
|
195
210
|
- spec/lib/severity_spec.rb
|
211
|
+
- spec/spec_helper.rb
|
data/fixture/github_pr.json
DELETED
@@ -1,333 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"url": "https://api.github.com/repos/ted3x/my-danger-test-sample/pulls/1",
|
3
|
-
"id": 221460271,
|
4
|
-
"node_id": "MDExOlB1bGxSZXF1ZXN0MjIxNDYwMjcx",
|
5
|
-
"html_url": "https://github.com/ted3x/my-danger-test-sample/pull/1",
|
6
|
-
"diff_url": "https://github.com/ted3x/my-danger-test-sample/pull/1.diff",
|
7
|
-
"patch_url": "https://github.com/ted3x/my-danger-test-sample/pull/1.patch",
|
8
|
-
"issue_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/issues/1",
|
9
|
-
"number": 1,
|
10
|
-
"state": "open",
|
11
|
-
"locked": false,
|
12
|
-
"title": "danger-checkstyle_format",
|
13
|
-
"user": {
|
14
|
-
"login": "ted3x",
|
15
|
-
"id": 4340693,
|
16
|
-
"node_id": "MDQ6VXNlcjQzNDA2OTM=",
|
17
|
-
"avatar_url": "https://avatars0.githubusercontent.com/u/4340693?v=4",
|
18
|
-
"gravatar_id": "",
|
19
|
-
"url": "https://api.github.com/users/ted3x",
|
20
|
-
"html_url": "https://github.com/ted3x",
|
21
|
-
"followers_url": "https://api.github.com/users/ted3x/followers",
|
22
|
-
"following_url": "https://api.github.com/users/ted3x/following{/other_user}",
|
23
|
-
"gists_url": "https://api.github.com/users/ted3x/gists{/gist_id}",
|
24
|
-
"starred_url": "https://api.github.com/users/ted3x/starred{/owner}{/repo}",
|
25
|
-
"subscriptions_url": "https://api.github.com/users/ted3x/subscriptions",
|
26
|
-
"organizations_url": "https://api.github.com/users/ted3x/orgs",
|
27
|
-
"repos_url": "https://api.github.com/users/ted3x/repos",
|
28
|
-
"events_url": "https://api.github.com/users/ted3x/events{/privacy}",
|
29
|
-
"received_events_url": "https://api.github.com/users/ted3x/received_events",
|
30
|
-
"type": "User",
|
31
|
-
"site_admin": false
|
32
|
-
},
|
33
|
-
"body": "",
|
34
|
-
"created_at": "2018-10-09T14:24:17Z",
|
35
|
-
"updated_at": "2018-10-09T14:24:17Z",
|
36
|
-
"closed_at": null,
|
37
|
-
"merged_at": null,
|
38
|
-
"merge_commit_sha": "ff47c9f445337664d38598e7db268735dcf2ee48",
|
39
|
-
"assignee": null,
|
40
|
-
"assignees": [
|
41
|
-
|
42
|
-
],
|
43
|
-
"requested_reviewers": [
|
44
|
-
|
45
|
-
],
|
46
|
-
"requested_teams": [
|
47
|
-
|
48
|
-
],
|
49
|
-
"labels": [
|
50
|
-
|
51
|
-
],
|
52
|
-
"milestone": null,
|
53
|
-
"commits_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/pulls/1/commits",
|
54
|
-
"review_comments_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/pulls/1/comments",
|
55
|
-
"review_comment_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/pulls/comments{/number}",
|
56
|
-
"comments_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/issues/1/comments",
|
57
|
-
"statuses_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/statuses/0338aa3df2e9f435d224f5dd31641e90d31a0b5a",
|
58
|
-
"head": {
|
59
|
-
"label": "ted3x:checkstyle_format_other",
|
60
|
-
"ref": "checkstyle_format_other",
|
61
|
-
"sha": "0338aa3df2e9f435d224f5dd31641e90d31a0b5a",
|
62
|
-
"user": {
|
63
|
-
"login": "ted3x",
|
64
|
-
"id": 4340693,
|
65
|
-
"node_id": "MDQ6VXNlcjQzNDA2OTM=",
|
66
|
-
"avatar_url": "https://avatars0.githubusercontent.com/u/4340693?v=4",
|
67
|
-
"gravatar_id": "",
|
68
|
-
"url": "https://api.github.com/users/ted3x",
|
69
|
-
"html_url": "https://github.com/ted3x",
|
70
|
-
"followers_url": "https://api.github.com/users/ted3x/followers",
|
71
|
-
"following_url": "https://api.github.com/users/ted3x/following{/other_user}",
|
72
|
-
"gists_url": "https://api.github.com/users/ted3x/gists{/gist_id}",
|
73
|
-
"starred_url": "https://api.github.com/users/ted3x/starred{/owner}{/repo}",
|
74
|
-
"subscriptions_url": "https://api.github.com/users/ted3x/subscriptions",
|
75
|
-
"organizations_url": "https://api.github.com/users/ted3x/orgs",
|
76
|
-
"repos_url": "https://api.github.com/users/ted3x/repos",
|
77
|
-
"events_url": "https://api.github.com/users/ted3x/events{/privacy}",
|
78
|
-
"received_events_url": "https://api.github.com/users/ted3x/received_events",
|
79
|
-
"type": "User",
|
80
|
-
"site_admin": false
|
81
|
-
},
|
82
|
-
"repo": {
|
83
|
-
"id": 152257381,
|
84
|
-
"node_id": "MDEwOlJlcG9zaXRvcnkxNTIyNTczODE=",
|
85
|
-
"name": "my-danger-test-sample",
|
86
|
-
"full_name": "ted3x/my-danger-test-sample",
|
87
|
-
"private": false,
|
88
|
-
"owner": {
|
89
|
-
"login": "ted3x",
|
90
|
-
"id": 4340693,
|
91
|
-
"node_id": "MDQ6VXNlcjQzNDA2OTM=",
|
92
|
-
"avatar_url": "https://avatars0.githubusercontent.com/u/4340693?v=4",
|
93
|
-
"gravatar_id": "",
|
94
|
-
"url": "https://api.github.com/users/ted3x",
|
95
|
-
"html_url": "https://github.com/ted3x",
|
96
|
-
"followers_url": "https://api.github.com/users/ted3x/followers",
|
97
|
-
"following_url": "https://api.github.com/users/ted3x/following{/other_user}",
|
98
|
-
"gists_url": "https://api.github.com/users/ted3x/gists{/gist_id}",
|
99
|
-
"starred_url": "https://api.github.com/users/ted3x/starred{/owner}{/repo}",
|
100
|
-
"subscriptions_url": "https://api.github.com/users/ted3x/subscriptions",
|
101
|
-
"organizations_url": "https://api.github.com/users/ted3x/orgs",
|
102
|
-
"repos_url": "https://api.github.com/users/ted3x/repos",
|
103
|
-
"events_url": "https://api.github.com/users/ted3x/events{/privacy}",
|
104
|
-
"received_events_url": "https://api.github.com/users/ted3x/received_events",
|
105
|
-
"type": "User",
|
106
|
-
"site_admin": false
|
107
|
-
},
|
108
|
-
"html_url": "https://github.com/ted3x/my-danger-test-sample",
|
109
|
-
"description": null,
|
110
|
-
"fork": false,
|
111
|
-
"url": "https://api.github.com/repos/ted3x/my-danger-test-sample",
|
112
|
-
"forks_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/forks",
|
113
|
-
"keys_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/keys{/key_id}",
|
114
|
-
"collaborators_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/collaborators{/collaborator}",
|
115
|
-
"teams_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/teams",
|
116
|
-
"hooks_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/hooks",
|
117
|
-
"issue_events_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/issues/events{/number}",
|
118
|
-
"events_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/events",
|
119
|
-
"assignees_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/assignees{/user}",
|
120
|
-
"branches_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/branches{/branch}",
|
121
|
-
"tags_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/tags",
|
122
|
-
"blobs_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/git/blobs{/sha}",
|
123
|
-
"git_tags_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/git/tags{/sha}",
|
124
|
-
"git_refs_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/git/refs{/sha}",
|
125
|
-
"trees_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/git/trees{/sha}",
|
126
|
-
"statuses_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/statuses/{sha}",
|
127
|
-
"languages_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/languages",
|
128
|
-
"stargazers_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/stargazers",
|
129
|
-
"contributors_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/contributors",
|
130
|
-
"subscribers_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/subscribers",
|
131
|
-
"subscription_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/subscription",
|
132
|
-
"commits_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/commits{/sha}",
|
133
|
-
"git_commits_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/git/commits{/sha}",
|
134
|
-
"comments_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/comments{/number}",
|
135
|
-
"issue_comment_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/issues/comments{/number}",
|
136
|
-
"contents_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/contents/{+path}",
|
137
|
-
"compare_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/compare/{base}...{head}",
|
138
|
-
"merges_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/merges",
|
139
|
-
"archive_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/{archive_format}{/ref}",
|
140
|
-
"downloads_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/downloads",
|
141
|
-
"issues_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/issues{/number}",
|
142
|
-
"pulls_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/pulls{/number}",
|
143
|
-
"milestones_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/milestones{/number}",
|
144
|
-
"notifications_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/notifications{?since,all,participating}",
|
145
|
-
"labels_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/labels{/name}",
|
146
|
-
"releases_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/releases{/id}",
|
147
|
-
"deployments_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/deployments",
|
148
|
-
"created_at": "2018-10-09T13:37:31Z",
|
149
|
-
"updated_at": "2018-10-09T14:23:25Z",
|
150
|
-
"pushed_at": "2018-10-09T14:24:18Z",
|
151
|
-
"git_url": "git://github.com/ted3x/my-danger-test-sample.git",
|
152
|
-
"ssh_url": "git@github.com:ted3x/my-danger-test-sample.git",
|
153
|
-
"clone_url": "https://github.com/ted3x/my-danger-test-sample.git",
|
154
|
-
"svn_url": "https://github.com/ted3x/my-danger-test-sample",
|
155
|
-
"homepage": null,
|
156
|
-
"size": 0,
|
157
|
-
"stargazers_count": 0,
|
158
|
-
"watchers_count": 0,
|
159
|
-
"language": "Java",
|
160
|
-
"has_issues": true,
|
161
|
-
"has_projects": true,
|
162
|
-
"has_downloads": true,
|
163
|
-
"has_wiki": true,
|
164
|
-
"has_pages": false,
|
165
|
-
"forks_count": 0,
|
166
|
-
"mirror_url": null,
|
167
|
-
"archived": false,
|
168
|
-
"open_issues_count": 1,
|
169
|
-
"license": null,
|
170
|
-
"forks": 0,
|
171
|
-
"open_issues": 1,
|
172
|
-
"watchers": 0,
|
173
|
-
"default_branch": "checkstyle_format_base"
|
174
|
-
}
|
175
|
-
},
|
176
|
-
"base": {
|
177
|
-
"label": "ted3x:checkstyle_format_base",
|
178
|
-
"ref": "checkstyle_format_base",
|
179
|
-
"sha": "da77d53a73db723cc9c4f78c4a4cd44efa1df85f",
|
180
|
-
"user": {
|
181
|
-
"login": "ted3x",
|
182
|
-
"id": 4340693,
|
183
|
-
"node_id": "MDQ6VXNlcjQzNDA2OTM=",
|
184
|
-
"avatar_url": "https://avatars0.githubusercontent.com/u/4340693?v=4",
|
185
|
-
"gravatar_id": "",
|
186
|
-
"url": "https://api.github.com/users/ted3x",
|
187
|
-
"html_url": "https://github.com/ted3x",
|
188
|
-
"followers_url": "https://api.github.com/users/ted3x/followers",
|
189
|
-
"following_url": "https://api.github.com/users/ted3x/following{/other_user}",
|
190
|
-
"gists_url": "https://api.github.com/users/ted3x/gists{/gist_id}",
|
191
|
-
"starred_url": "https://api.github.com/users/ted3x/starred{/owner}{/repo}",
|
192
|
-
"subscriptions_url": "https://api.github.com/users/ted3x/subscriptions",
|
193
|
-
"organizations_url": "https://api.github.com/users/ted3x/orgs",
|
194
|
-
"repos_url": "https://api.github.com/users/ted3x/repos",
|
195
|
-
"events_url": "https://api.github.com/users/ted3x/events{/privacy}",
|
196
|
-
"received_events_url": "https://api.github.com/users/ted3x/received_events",
|
197
|
-
"type": "User",
|
198
|
-
"site_admin": false
|
199
|
-
},
|
200
|
-
"repo": {
|
201
|
-
"id": 152257381,
|
202
|
-
"node_id": "MDEwOlJlcG9zaXRvcnkxNTIyNTczODE=",
|
203
|
-
"name": "my-danger-test-sample",
|
204
|
-
"full_name": "ted3x/my-danger-test-sample",
|
205
|
-
"private": false,
|
206
|
-
"owner": {
|
207
|
-
"login": "ted3x",
|
208
|
-
"id": 4340693,
|
209
|
-
"node_id": "MDQ6VXNlcjQzNDA2OTM=",
|
210
|
-
"avatar_url": "https://avatars0.githubusercontent.com/u/4340693?v=4",
|
211
|
-
"gravatar_id": "",
|
212
|
-
"url": "https://api.github.com/users/ted3x",
|
213
|
-
"html_url": "https://github.com/ted3x",
|
214
|
-
"followers_url": "https://api.github.com/users/ted3x/followers",
|
215
|
-
"following_url": "https://api.github.com/users/ted3x/following{/other_user}",
|
216
|
-
"gists_url": "https://api.github.com/users/ted3x/gists{/gist_id}",
|
217
|
-
"starred_url": "https://api.github.com/users/ted3x/starred{/owner}{/repo}",
|
218
|
-
"subscriptions_url": "https://api.github.com/users/ted3x/subscriptions",
|
219
|
-
"organizations_url": "https://api.github.com/users/ted3x/orgs",
|
220
|
-
"repos_url": "https://api.github.com/users/ted3x/repos",
|
221
|
-
"events_url": "https://api.github.com/users/ted3x/events{/privacy}",
|
222
|
-
"received_events_url": "https://api.github.com/users/ted3x/received_events",
|
223
|
-
"type": "User",
|
224
|
-
"site_admin": false
|
225
|
-
},
|
226
|
-
"html_url": "https://github.com/ted3x/my-danger-test-sample",
|
227
|
-
"description": null,
|
228
|
-
"fork": false,
|
229
|
-
"url": "https://api.github.com/repos/ted3x/my-danger-test-sample",
|
230
|
-
"forks_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/forks",
|
231
|
-
"keys_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/keys{/key_id}",
|
232
|
-
"collaborators_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/collaborators{/collaborator}",
|
233
|
-
"teams_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/teams",
|
234
|
-
"hooks_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/hooks",
|
235
|
-
"issue_events_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/issues/events{/number}",
|
236
|
-
"events_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/events",
|
237
|
-
"assignees_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/assignees{/user}",
|
238
|
-
"branches_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/branches{/branch}",
|
239
|
-
"tags_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/tags",
|
240
|
-
"blobs_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/git/blobs{/sha}",
|
241
|
-
"git_tags_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/git/tags{/sha}",
|
242
|
-
"git_refs_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/git/refs{/sha}",
|
243
|
-
"trees_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/git/trees{/sha}",
|
244
|
-
"statuses_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/statuses/{sha}",
|
245
|
-
"languages_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/languages",
|
246
|
-
"stargazers_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/stargazers",
|
247
|
-
"contributors_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/contributors",
|
248
|
-
"subscribers_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/subscribers",
|
249
|
-
"subscription_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/subscription",
|
250
|
-
"commits_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/commits{/sha}",
|
251
|
-
"git_commits_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/git/commits{/sha}",
|
252
|
-
"comments_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/comments{/number}",
|
253
|
-
"issue_comment_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/issues/comments{/number}",
|
254
|
-
"contents_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/contents/{+path}",
|
255
|
-
"compare_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/compare/{base}...{head}",
|
256
|
-
"merges_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/merges",
|
257
|
-
"archive_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/{archive_format}{/ref}",
|
258
|
-
"downloads_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/downloads",
|
259
|
-
"issues_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/issues{/number}",
|
260
|
-
"pulls_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/pulls{/number}",
|
261
|
-
"milestones_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/milestones{/number}",
|
262
|
-
"notifications_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/notifications{?since,all,participating}",
|
263
|
-
"labels_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/labels{/name}",
|
264
|
-
"releases_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/releases{/id}",
|
265
|
-
"deployments_url": "https://api.github.com/repos/ted3x/my-danger-test-sample/deployments",
|
266
|
-
"created_at": "2018-10-09T13:37:31Z",
|
267
|
-
"updated_at": "2018-10-09T14:23:25Z",
|
268
|
-
"pushed_at": "2018-10-09T14:24:18Z",
|
269
|
-
"git_url": "git://github.com/ted3x/my-danger-test-sample.git",
|
270
|
-
"ssh_url": "git@github.com:ted3x/my-danger-test-sample.git",
|
271
|
-
"clone_url": "https://github.com/ted3x/my-danger-test-sample.git",
|
272
|
-
"svn_url": "https://github.com/ted3x/my-danger-test-sample",
|
273
|
-
"homepage": null,
|
274
|
-
"size": 0,
|
275
|
-
"stargazers_count": 0,
|
276
|
-
"watchers_count": 0,
|
277
|
-
"language": "Java",
|
278
|
-
"has_issues": true,
|
279
|
-
"has_projects": true,
|
280
|
-
"has_downloads": true,
|
281
|
-
"has_wiki": true,
|
282
|
-
"has_pages": false,
|
283
|
-
"forks_count": 0,
|
284
|
-
"mirror_url": null,
|
285
|
-
"archived": false,
|
286
|
-
"open_issues_count": 1,
|
287
|
-
"license": null,
|
288
|
-
"forks": 0,
|
289
|
-
"open_issues": 1,
|
290
|
-
"watchers": 0,
|
291
|
-
"default_branch": "checkstyle_format_base"
|
292
|
-
}
|
293
|
-
},
|
294
|
-
"_links": {
|
295
|
-
"self": {
|
296
|
-
"href": "https://api.github.com/repos/ted3x/my-danger-test-sample/pulls/1"
|
297
|
-
},
|
298
|
-
"html": {
|
299
|
-
"href": "https://github.com/ted3x/my-danger-test-sample/pull/1"
|
300
|
-
},
|
301
|
-
"issue": {
|
302
|
-
"href": "https://api.github.com/repos/ted3x/my-danger-test-sample/issues/1"
|
303
|
-
},
|
304
|
-
"comments": {
|
305
|
-
"href": "https://api.github.com/repos/ted3x/my-danger-test-sample/issues/1/comments"
|
306
|
-
},
|
307
|
-
"review_comments": {
|
308
|
-
"href": "https://api.github.com/repos/ted3x/my-danger-test-sample/pulls/1/comments"
|
309
|
-
},
|
310
|
-
"review_comment": {
|
311
|
-
"href": "https://api.github.com/repos/ted3x/my-danger-test-sample/pulls/comments{/number}"
|
312
|
-
},
|
313
|
-
"commits": {
|
314
|
-
"href": "https://api.github.com/repos/ted3x/my-danger-test-sample/pulls/1/commits"
|
315
|
-
},
|
316
|
-
"statuses": {
|
317
|
-
"href": "https://api.github.com/repos/ted3x/my-danger-test-sample/statuses/0338aa3df2e9f435d224f5dd31641e90d31a0b5a"
|
318
|
-
}
|
319
|
-
},
|
320
|
-
"author_association": "OWNER",
|
321
|
-
"merged": false,
|
322
|
-
"mergeable": true,
|
323
|
-
"rebaseable": true,
|
324
|
-
"mergeable_state": "clean",
|
325
|
-
"merged_by": null,
|
326
|
-
"comments": 0,
|
327
|
-
"review_comments": 0,
|
328
|
-
"maintainer_can_modify": false,
|
329
|
-
"commits": 2,
|
330
|
-
"additions": 22,
|
331
|
-
"deletions": 8,
|
332
|
-
"changed_files": 3
|
333
|
-
}
|