codeclimate 0.85.27 → 0.86.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/engines.yml +1 -0
- data/lib/cc/analyzer/container.rb +12 -12
- data/lib/cc/cli/file_store.rb +1 -1
- data/lib/cc/cli/prepare.rb +1 -0
- data/lib/cc/config/prepare.rb +4 -0
- data/lib/cc/config.rb +4 -2
- metadata +15 -38
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff82fca07cdf87fc66cd1f5999de48ca7361160a82de553ba9d08c4b50cf84d9
|
4
|
+
data.tar.gz: 2232adc3deb9897164a58e91e1228ec8d39c29a36eb66e393ec03d783ffe28a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2095d9f29f26838ac72b91c433b306e93bef66185427eacf100c995619941c012c77d5623f136f651705c3e25ddf0a420a729bacd36d2b7423fce2d5588dd058
|
7
|
+
data.tar.gz: e80478964ff1133009fa0cecb81c127cb2c430381b5c77442acfeb33b87f445592d024143a4895932e745a33a23e62f55db8042110519ee5539a814c7725c104
|
data/config/engines.yml
CHANGED
@@ -81,6 +81,7 @@ eslint:
|
|
81
81
|
eslint-5: codeclimate/codeclimate-eslint:eslint-5
|
82
82
|
eslint-6: codeclimate/codeclimate-eslint:eslint-6
|
83
83
|
eslint-7: codeclimate/codeclimate-eslint:eslint-7
|
84
|
+
eslint-8: codeclimate/codeclimate-eslint:eslint-8
|
84
85
|
description: A JavaScript/JSX linting utility.
|
85
86
|
flog:
|
86
87
|
channels:
|
@@ -1,5 +1,5 @@
|
|
1
|
-
require "posix/spawn"
|
2
1
|
require "cc/analyzer/container/result"
|
2
|
+
require "open3"
|
3
3
|
|
4
4
|
module CC
|
5
5
|
module Analyzer
|
@@ -52,19 +52,14 @@ module CC
|
|
52
52
|
|
53
53
|
command = docker_run_command(options)
|
54
54
|
Analyzer.logger.debug("docker run: #{command.inspect}")
|
55
|
-
|
55
|
+
_, out, err, @t_wait = Open3.popen3(*command)
|
56
56
|
|
57
57
|
@t_out = read_stdout(out)
|
58
58
|
@t_err = read_stderr(err)
|
59
59
|
t_timeout = timeout_thread
|
60
60
|
|
61
|
-
#
|
62
|
-
|
63
|
-
# could still block here forever if the docker-kill/wait is not
|
64
|
-
# successful. there may still be stdout in flight if it was being
|
65
|
-
# produced more quickly than consumed.
|
66
|
-
@t_wait = Thread.new { _, @status = Process.waitpid2(pid) }
|
67
|
-
@t_wait.join
|
61
|
+
# Calling @t_wait.value waits the termination of the process / engine
|
62
|
+
@status = @t_wait.value
|
68
63
|
|
69
64
|
# blocks until all readers are done. they're still governed by the
|
70
65
|
# timeout thread at this point. if we hit the timeout while processing
|
@@ -97,6 +92,9 @@ module CC
|
|
97
92
|
def stop(message = nil)
|
98
93
|
reap_running_container(message)
|
99
94
|
kill_reader_threads
|
95
|
+
# Manually killing the process otherwise a run-away container
|
96
|
+
# could still block here forever if the docker-kill/wait is not
|
97
|
+
# successful
|
100
98
|
kill_wait_thread
|
101
99
|
end
|
102
100
|
|
@@ -178,9 +176,11 @@ module CC
|
|
178
176
|
|
179
177
|
def reap_running_container(message)
|
180
178
|
Analyzer.logger.warn("killing container name=#{@name} message=#{message.inspect}")
|
181
|
-
|
182
|
-
|
183
|
-
|
179
|
+
Timeout.timeout(2.minutes.to_i) do
|
180
|
+
Kernel.system("docker", "kill", @name, [:out, :err] => File::NULL)
|
181
|
+
Kernel.system("docker", "wait", @name, [:out, :err] => File::NULL)
|
182
|
+
end
|
183
|
+
rescue Timeout::Error
|
184
184
|
Analyzer.logger.error("unable to kill container name=#{@name} message=#{message.inspect}")
|
185
185
|
Analyzer.statsd.increment("container.zombie")
|
186
186
|
Analyzer.statsd.increment("container.zombie.#{metric_name}") if metric_name
|
data/lib/cc/cli/file_store.rb
CHANGED
@@ -31,7 +31,7 @@ module CC
|
|
31
31
|
@data =
|
32
32
|
if File.exist? self.class::FILE_NAME
|
33
33
|
File.open(self.class::FILE_NAME, "r:bom|utf-8") do |f|
|
34
|
-
YAML.safe_load(f, [Time], [], false, self.class::FILE_NAME)
|
34
|
+
YAML.safe_load(f, permitted_classes: [Time], permitted_symbols: [], aliases: false, filename: self.class::FILE_NAME) || {}
|
35
35
|
end
|
36
36
|
else
|
37
37
|
{}
|
data/lib/cc/cli/prepare.rb
CHANGED
data/lib/cc/config/prepare.rb
CHANGED
data/lib/cc/config.rb
CHANGED
@@ -40,10 +40,12 @@ module CC
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def self.build(data)
|
43
|
+
prepare = Prepare.from_data(data["prepare"])
|
44
|
+
base_excluded_patterns = data.fetch("exclude_patterns", DefaultAdapter::EXCLUDE_PATTERNS)
|
43
45
|
new(
|
44
46
|
engines: EngineSet.new(data.fetch("plugins", {})).engines,
|
45
|
-
exclude_patterns:
|
46
|
-
prepare:
|
47
|
+
exclude_patterns: base_excluded_patterns + prepare.fetch.paths,
|
48
|
+
prepare: prepare,
|
47
49
|
)
|
48
50
|
end
|
49
51
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codeclimate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.86.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code Climate
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -44,40 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
48
|
-
- - ">="
|
49
|
-
- !ruby/object:Gem::Version
|
50
|
-
version: 1.7.2
|
47
|
+
version: 2.0.3
|
51
48
|
type: :runtime
|
52
49
|
prerelease: false
|
53
50
|
version_requirements: !ruby/object:Gem::Requirement
|
54
51
|
requirements:
|
55
52
|
- - "~>"
|
56
53
|
- !ruby/object:Gem::Version
|
57
|
-
version:
|
58
|
-
- - ">="
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: 1.7.2
|
61
|
-
- !ruby/object:Gem::Dependency
|
62
|
-
name: posix-spawn
|
63
|
-
requirement: !ruby/object:Gem::Requirement
|
64
|
-
requirements:
|
65
|
-
- - "~>"
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: '0.3'
|
68
|
-
- - ">="
|
69
|
-
- !ruby/object:Gem::Version
|
70
|
-
version: 0.3.11
|
71
|
-
type: :runtime
|
72
|
-
prerelease: false
|
73
|
-
version_requirements: !ruby/object:Gem::Requirement
|
74
|
-
requirements:
|
75
|
-
- - "~>"
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: '0.3'
|
78
|
-
- - ">="
|
79
|
-
- !ruby/object:Gem::Version
|
80
|
-
version: 0.3.11
|
54
|
+
version: 2.0.3
|
81
55
|
- !ruby/object:Gem::Dependency
|
82
56
|
name: pry
|
83
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -96,22 +70,22 @@ dependencies:
|
|
96
70
|
name: rainbow
|
97
71
|
requirement: !ruby/object:Gem::Requirement
|
98
72
|
requirements:
|
99
|
-
- - ">="
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
version: 2.0.0
|
102
73
|
- - "~>"
|
103
74
|
- !ruby/object:Gem::Version
|
104
75
|
version: '2.0'
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: 2.0.0
|
105
79
|
type: :runtime
|
106
80
|
prerelease: false
|
107
81
|
version_requirements: !ruby/object:Gem::Requirement
|
108
82
|
requirements:
|
109
|
-
- - ">="
|
110
|
-
- !ruby/object:Gem::Version
|
111
|
-
version: 2.0.0
|
112
83
|
- - "~>"
|
113
84
|
- !ruby/object:Gem::Version
|
114
85
|
version: '2.0'
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: 2.0.0
|
115
89
|
- !ruby/object:Gem::Dependency
|
116
90
|
name: redcarpet
|
117
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -256,16 +230,19 @@ require_paths:
|
|
256
230
|
- lib
|
257
231
|
required_ruby_version: !ruby/object:Gem::Requirement
|
258
232
|
requirements:
|
259
|
-
- - "
|
233
|
+
- - ">="
|
260
234
|
- !ruby/object:Gem::Version
|
261
235
|
version: '2.6'
|
236
|
+
- - "<="
|
237
|
+
- !ruby/object:Gem::Version
|
238
|
+
version: 3.1.2
|
262
239
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
263
240
|
requirements:
|
264
241
|
- - ">="
|
265
242
|
- !ruby/object:Gem::Version
|
266
243
|
version: '0'
|
267
244
|
requirements: []
|
268
|
-
rubygems_version: 3.
|
245
|
+
rubygems_version: 3.3.7
|
269
246
|
signing_key:
|
270
247
|
specification_version: 4
|
271
248
|
summary: Code Climate CLI
|