codeclimate-engine-rb 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rspec +1 -0
- data/README.md +1 -1
- data/codeclimate_engine.gemspec +1 -2
- data/lib/cc_engine/config.rb +1 -1
- data/lib/cc_engine/issue.rb +27 -9
- data/lib/cc_engine/location/line_range.rb +8 -6
- data/lib/cc_engine/location/position.rb +9 -7
- data/lib/cc_engine/position/grid.rb +6 -6
- data/lib/cc_engine/position/offset.rb +7 -5
- data/lib/cc_engine/version.rb +1 -1
- metadata +15 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 96bfcb4a51e27a6ecd8ae91d51a199ee12a0fc2150f241fba3adaecc2533bf2d
|
4
|
+
data.tar.gz: 953e685ef59776ad00b8caefe1902a4cd8f6c77d919d02d8ba513edad16cbbdf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4d1a6cbaa5b8dce90e17386bf701bb78d6174057e3d58ea1cebc60e03805683c5c63e8ce04dfbb8ed0e99e735341dcadd353bd49bbb2362c081de3f6d3293cb
|
7
|
+
data.tar.gz: a84b3c0821b6ee29417106c847bbac103b635df98b75858377e578d8999eca66d6af1066192c415f220262375138279fa96d72fe4afb543e35c7f15b3e6cb8e9
|
data/.rspec
CHANGED
data/README.md
CHANGED
data/codeclimate_engine.gemspec
CHANGED
@@ -19,9 +19,8 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.add_development_dependency "bundler", "
|
22
|
+
spec.add_development_dependency "bundler", ">= 1.9", "< 3.0"
|
23
23
|
spec.add_development_dependency "rake", "~> 10.0"
|
24
24
|
spec.add_development_dependency "rspec", "~> 3.3"
|
25
|
-
spec.add_dependency "virtus", "~> 1.0"
|
26
25
|
end
|
27
26
|
# rubocop:enable Metrics/LineLength
|
data/lib/cc_engine/config.rb
CHANGED
data/lib/cc_engine/issue.rb
CHANGED
@@ -1,17 +1,25 @@
|
|
1
|
-
require "virtus"
|
2
1
|
require "json"
|
3
2
|
|
4
3
|
module CCEngine
|
5
4
|
class Issue
|
6
|
-
include Virtus.model(strict: true)
|
7
5
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
6
|
+
def initialize(
|
7
|
+
check_name:,
|
8
|
+
description:,
|
9
|
+
categories:,
|
10
|
+
location:,
|
11
|
+
remediation_points:,
|
12
|
+
content:,
|
13
|
+
fingerprint:
|
14
|
+
)
|
15
|
+
@check_name = check_name
|
16
|
+
@description = description
|
17
|
+
@categories = categories
|
18
|
+
@location = location
|
19
|
+
@remediation_points = remediation_points
|
20
|
+
@content = content
|
21
|
+
@fingerprint = fingerprint
|
22
|
+
end
|
15
23
|
|
16
24
|
def render
|
17
25
|
to_hash.to_json + "\0"
|
@@ -58,5 +66,15 @@ module CCEngine
|
|
58
66
|
fingerprint: fingerprint
|
59
67
|
}
|
60
68
|
end
|
69
|
+
|
70
|
+
private
|
71
|
+
|
72
|
+
attr_reader :check_name,
|
73
|
+
:description,
|
74
|
+
:categories,
|
75
|
+
:location,
|
76
|
+
:remediation_points,
|
77
|
+
:content,
|
78
|
+
:fingerprint
|
61
79
|
end
|
62
80
|
end
|
@@ -1,12 +1,10 @@
|
|
1
|
-
require "virtus"
|
2
|
-
|
3
1
|
module CCEngine
|
4
2
|
module Location
|
5
3
|
class LineRange
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
4
|
+
def initialize(path:, line_range:)
|
5
|
+
@path = path
|
6
|
+
@line_range = line_range
|
7
|
+
end
|
10
8
|
|
11
9
|
def to_hash
|
12
10
|
{
|
@@ -17,6 +15,10 @@ module CCEngine
|
|
17
15
|
}
|
18
16
|
}
|
19
17
|
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
attr_reader :path, :line_range
|
20
22
|
end
|
21
23
|
end
|
22
24
|
end
|
@@ -1,13 +1,11 @@
|
|
1
|
-
require "virtus"
|
2
|
-
|
3
1
|
module CCEngine
|
4
2
|
module Location
|
5
3
|
class Position
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
4
|
+
def initialize(path:, start_position:, end_position:)
|
5
|
+
@path = path
|
6
|
+
@start_position = start_position
|
7
|
+
@end_position = end_position
|
8
|
+
end
|
11
9
|
|
12
10
|
def to_hash
|
13
11
|
{
|
@@ -18,6 +16,10 @@ module CCEngine
|
|
18
16
|
}
|
19
17
|
}
|
20
18
|
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
attr_reader :path, :start_position, :end_position
|
21
23
|
end
|
22
24
|
end
|
23
25
|
end
|
@@ -1,12 +1,10 @@
|
|
1
|
-
require "virtus"
|
2
|
-
|
3
1
|
module CCEngine
|
4
2
|
module Position
|
5
3
|
class Grid
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
4
|
+
def initialize(line:, column:)
|
5
|
+
@line = line
|
6
|
+
@column = column
|
7
|
+
end
|
10
8
|
|
11
9
|
def to_hash
|
12
10
|
{
|
@@ -14,6 +12,8 @@ module CCEngine
|
|
14
12
|
column: column
|
15
13
|
}
|
16
14
|
end
|
15
|
+
|
16
|
+
attr_reader :line, :column
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -1,17 +1,19 @@
|
|
1
|
-
require "virtus"
|
2
|
-
|
3
1
|
module CCEngine
|
4
2
|
module Position
|
5
3
|
class Offset
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
def initialize(offset:)
|
5
|
+
@offset = offset
|
6
|
+
end
|
9
7
|
|
10
8
|
def to_hash
|
11
9
|
{
|
12
10
|
offset: offset
|
13
11
|
}
|
14
12
|
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
attr_reader :offset
|
15
17
|
end
|
16
18
|
end
|
17
19
|
end
|
data/lib/cc_engine/version.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codeclimate-engine-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Waite
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.9'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '3.0'
|
20
23
|
type: :development
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '1.9'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '3.0'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: rake
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,21 +58,7 @@ dependencies:
|
|
52
58
|
- - "~>"
|
53
59
|
- !ruby/object:Gem::Version
|
54
60
|
version: '3.3'
|
55
|
-
|
56
|
-
name: virtus
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '1.0'
|
62
|
-
type: :runtime
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '1.0'
|
69
|
-
description:
|
61
|
+
description:
|
70
62
|
email:
|
71
63
|
- github.aw@andywaite.com
|
72
64
|
executables: []
|
@@ -98,7 +90,7 @@ homepage: https://github.com/andyw8/codeclimate-engine-rb
|
|
98
90
|
licenses:
|
99
91
|
- MIT
|
100
92
|
metadata: {}
|
101
|
-
post_install_message:
|
93
|
+
post_install_message:
|
102
94
|
rdoc_options: []
|
103
95
|
require_paths:
|
104
96
|
- lib
|
@@ -113,9 +105,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
105
|
- !ruby/object:Gem::Version
|
114
106
|
version: '0'
|
115
107
|
requirements: []
|
116
|
-
|
117
|
-
|
118
|
-
signing_key:
|
108
|
+
rubygems_version: 3.1.6
|
109
|
+
signing_key:
|
119
110
|
specification_version: 4
|
120
111
|
summary: JSON issue formatter for the Code Climate engine
|
121
112
|
test_files: []
|