codeclimate 0.64.0 → 0.65.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5ee40902085c53ff3be8c9c6dba5dac688704039
4
- data.tar.gz: ca401b80cb5650750d266c1d768d6511250b3015
3
+ metadata.gz: 5feeacf2accb9e86190a130132a3b9517918819b
4
+ data.tar.gz: 662b8149a617b44c70c939ab77e512a9159ea887
5
5
  SHA512:
6
- metadata.gz: edcab9dd647664d6bf161bde34f53e8e343c894971561d3b1ed09f4dd0a0d81b0fe92ffb626ecb023ec0c4d2ca7fe9e7235404a5748526ca50b15ed0c4e472ae
7
- data.tar.gz: 8ce93a41f8c3939a7dd254c31fdc7affb8bc033079469279972732a7b015ca842d3746cd8c1ef5b669eb66df7c084df58797d06ed7251266b9c91f9738833bc8
6
+ metadata.gz: bf28bdb099ac1b6f38650323416b5a54de24d8fb754a24a0c10b3b8fe53f364677a88c3b46fbcd5f39b6130f2ef967b6cefff8067d22d8188184773af90fcb0c
7
+ data.tar.gz: 255b5817be38d438717f3212a7aa26a5cd832d709e48389cf198395882df9780b281498fb468e4334f30b7ce2348d4a27cf592646f645e0fa016cf57084c4f03
@@ -9,6 +9,7 @@ module CC
9
9
  autoload :Engine, "cc/analyzer/engine"
10
10
  autoload :EngineOutput, "cc/analyzer/engine_output"
11
11
  autoload :EngineOutputFilter, "cc/analyzer/engine_output_filter"
12
+ autoload :EngineOutputOverrider, "cc/analyzer/engine_output_overrider"
12
13
  autoload :EngineRegistry, "cc/analyzer/engine_registry"
13
14
  autoload :EnginesConfigBuilder, "cc/analyzer/engines_config_builder"
14
15
  autoload :EnginesRunner, "cc/analyzer/engines_runner"
@@ -43,7 +43,7 @@ module CC
43
43
  end
44
44
 
45
45
  unless output_filter.filter?(output)
46
- stdout_io.write(output.to_json) || container.stop
46
+ stdout_io.write(output_overrider.apply(output).to_json) || container.stop
47
47
  end
48
48
  end
49
49
 
@@ -101,6 +101,10 @@ module CC
101
101
  @output_filter ||= EngineOutputFilter.new(@config)
102
102
  end
103
103
 
104
+ def output_overrider
105
+ @output_overrider ||= EngineOutputOverrider.new(@config)
106
+ end
107
+
104
108
  # Memory limit for a running engine in bytes
105
109
  def memory_limit
106
110
  (ENV["ENGINE_MEMORY_LIMIT_BYTES"] || DEFAULT_MEMORY_LIMIT).to_s
@@ -0,0 +1,31 @@
1
+ module CC
2
+ module Analyzer
3
+ class EngineOutputOverrider
4
+ def initialize(config = {})
5
+ @config = config
6
+ end
7
+
8
+ def apply(output)
9
+ if output.issue?
10
+ override_severity(output.as_issue.as_json)
11
+ else
12
+ output
13
+ end
14
+ end
15
+
16
+ private
17
+
18
+ attr_reader :config
19
+
20
+ def override_severity(issue)
21
+ issue.merge(override("severity"))
22
+ end
23
+
24
+ def override(name)
25
+ config.
26
+ fetch("issue_override", {}).
27
+ slice(name)
28
+ end
29
+ end
30
+ end
31
+ end
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.64.0
4
+ version: 0.65.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: 2017-06-21 00:00:00.000000000 Z
11
+ date: 2017-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -50,14 +50,14 @@ dependencies:
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: 0.12.0
53
+ version: 0.13.0
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: 0.12.0
60
+ version: 0.13.0
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: highline
63
63
  requirement: !ruby/object:Gem::Requirement
@@ -200,6 +200,7 @@ files:
200
200
  - lib/cc/analyzer/engine.rb
201
201
  - lib/cc/analyzer/engine_output.rb
202
202
  - lib/cc/analyzer/engine_output_filter.rb
203
+ - lib/cc/analyzer/engine_output_overrider.rb
203
204
  - lib/cc/analyzer/engine_registry.rb
204
205
  - lib/cc/analyzer/engines_config_builder.rb
205
206
  - lib/cc/analyzer/engines_runner.rb
@@ -293,4 +294,3 @@ signing_key:
293
294
  specification_version: 4
294
295
  summary: Code Climate CLI
295
296
  test_files: []
296
- has_rdoc: