codeclimate 0.36.0 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 91a10c3e93da22accfbddc12c297f54c7d632573
4
- data.tar.gz: 060ed4497e4c74f19fb4d2f9e48da5b0ee6cd49b
3
+ metadata.gz: b1c7d46430efa8e5178df3c41f8c57e563bc72b9
4
+ data.tar.gz: d22c7d49422fed9d3fe564c9731d96e780a3a0b4
5
5
  SHA512:
6
- metadata.gz: 261cd76725b1d6680d6b6ce0e601bfe1bf64ad5a54c434ecd3ba900b45a9a9e1245a535106398ff3b7ae16a72f278378afade284ff2405fb0c5d74399a054cd8
7
- data.tar.gz: 1611d05f380bddc6ad5f92eec36397153af8d663536fbb617ad957404bcb5feb9ac49d9cd5f021c09c4e818535a1c725a93d90f8da6f8b540bc5783608f47206
6
+ metadata.gz: ee00fc6546557ba7a8fa6379098c48655568363d4bc06d6f16f129c36101096ee198678bae3114a0300eb1d8d2fa005f9e0fe2e14e2864f4dda51b1c0b40c4ab
7
+ data.tar.gz: 50344aa2d1c7f4c76a963f679310043311eecad6edbe9d9e5fd24e1fb019632bd114cb855899dd059bb58cc804200f257cd0739baab70c0afc738007e39d5a28
data/config/engines.yml CHANGED
@@ -59,8 +59,22 @@ coffeelint:
59
59
  - \.coffee$
60
60
  default_ratings_paths:
61
61
  - "**.coffee"
62
+ credo:
63
+ channels:
64
+ beta: codeclimate/codeclimate-credo:beta
65
+ description: >
66
+ A static code analysis tool for the Elixir language with a focus on code
67
+ consistency and teaching.
68
+ community: true
69
+ enable_regexps:
70
+ - \.ex$
71
+ - \.exs$
72
+ default_ratings_paths:
73
+ - "**.ex"
74
+ - "**.exs"
62
75
  duplication:
63
76
  channels:
77
+ beta: codeclimate/codeclimate-duplication:beta
64
78
  stable: codeclimate/codeclimate-duplication
65
79
  description: Structural duplication detection for Ruby, Python, JavaScript, and PHP.
66
80
  community: false
@@ -7,7 +7,18 @@ module CC
7
7
  @output = output
8
8
  end
9
9
 
10
- def write(_data)
10
+ def write(data)
11
+ json = JSON.parse(data)
12
+ json["engine_name"] = current_engine.name
13
+
14
+ case json["type"].downcase
15
+ when "issue"
16
+ issues << json
17
+ when "warning"
18
+ warnings << json
19
+ else
20
+ raise "Invalid type found: #{json["type"]}"
21
+ end
11
22
  end
12
23
 
13
24
  def started
@@ -26,20 +26,6 @@ module CC
26
26
  end
27
27
  end
28
28
 
29
- def write(data)
30
- json = JSON.parse(data)
31
- json["engine_name"] = current_engine.name
32
-
33
- case json["type"].downcase
34
- when "issue"
35
- issues << json
36
- when "warning"
37
- warnings << json
38
- else
39
- raise "Invalid type found: #{json["type"]}"
40
- end
41
- end
42
-
43
29
  def finished
44
30
  template = ReportTemplate.new(issues.length, issues_by_path)
45
31
  puts template.render
@@ -10,20 +10,6 @@ module CC
10
10
  puts colorize("Starting analysis", :green)
11
11
  end
12
12
 
13
- def write(data)
14
- json = JSON.parse(data)
15
- json["engine_name"] = current_engine.name
16
-
17
- case json["type"].downcase
18
- when "issue"
19
- issues << json
20
- when "warning"
21
- warnings << json
22
- else
23
- raise "Invalid type found: #{json["type"]}"
24
- end
25
- end
26
-
27
13
  def finished
28
14
  puts
29
15
 
@@ -15,10 +15,6 @@ module CC
15
15
  def has_content?
16
16
  object.key?("content")
17
17
  end
18
-
19
- def content
20
- object["content"]
21
- end
22
18
  end
23
19
  end
24
20
  end
@@ -3,18 +3,12 @@ module CC
3
3
  module IssueValidations
4
4
  class PathExistenceValidation < Validation
5
5
  def valid?
6
- File.exist?(path)
6
+ path && File.exist?(path)
7
7
  end
8
8
 
9
9
  def message
10
10
  "File does not exist: '#{path}'"
11
11
  end
12
-
13
- private
14
-
15
- def path
16
- object.fetch("location", {}).fetch("path", "")
17
- end
18
12
  end
19
13
  end
20
14
  end
@@ -3,18 +3,12 @@ module CC
3
3
  module IssueValidations
4
4
  class PathIsFileValidation < Validation
5
5
  def valid?
6
- File.file?(path)
6
+ path && File.file?(path)
7
7
  end
8
8
 
9
9
  def message
10
10
  "Path is not a file: '#{path}'"
11
11
  end
12
-
13
- private
14
-
15
- def path
16
- object.fetch("location", {}).fetch("path", "")
17
- end
18
12
  end
19
13
  end
20
14
  end
@@ -9,12 +9,6 @@ module CC
9
9
  def message
10
10
  "Path must be present"
11
11
  end
12
-
13
- private
14
-
15
- def path
16
- object.fetch("location", {})["path"]
17
- end
18
12
  end
19
13
  end
20
14
  end
@@ -22,10 +22,6 @@ module CC
22
22
 
23
23
  expanded_path.start_with?(expanded_base)
24
24
  end
25
-
26
- def path
27
- object.fetch("location", {})["path"]
28
- end
29
25
  end
30
26
  end
31
27
  end
@@ -9,12 +9,6 @@ module CC
9
9
  def message
10
10
  "Type must be 'issue' but was '#{type}'"
11
11
  end
12
-
13
- private
14
-
15
- def type
16
- object["type"]
17
- end
18
12
  end
19
13
  end
20
14
  end
@@ -17,6 +17,18 @@ module CC
17
17
  private
18
18
 
19
19
  attr_reader :object
20
+
21
+ def path
22
+ object.fetch("location", {})["path"]
23
+ end
24
+
25
+ def type
26
+ object["type"]
27
+ end
28
+
29
+ def content
30
+ object["content"]
31
+ end
20
32
  end
21
33
  end
22
34
  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.36.0
4
+ version: 0.37.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: 2016-09-08 00:00:00.000000000 Z
11
+ date: 2016-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -251,7 +251,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
251
251
  version: '0'
252
252
  requirements: []
253
253
  rubyforge_project:
254
- rubygems_version: 2.4.5.1
254
+ rubygems_version: 2.5.1
255
255
  signing_key:
256
256
  specification_version: 4
257
257
  summary: Code Climate CLI