codeclimate 0.11.0 → 0.13.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: 9516f4110843547b299db402d54230e61bb63b80
4
- data.tar.gz: 3fc082327dd10c49850935b9a7f2cdf3d446ec0b
3
+ metadata.gz: a802a87b63c111d67efe9d1663f178e29248ec13
4
+ data.tar.gz: 6d583607b2efdcc87ec46206a25147de6e1c3d0e
5
5
  SHA512:
6
- metadata.gz: e890e440bccebf48ea429e7cd542b1a2108edba0211b221cc10e91f91e03de92b5619097c8e2154c9a2009b71c24637d2c159dcdf4eb08670ed885fd9cc328a3
7
- data.tar.gz: a9a276927f30546b55d24ed7c3e79737a444c946f22b2aae940975f6531e3536747a3b305a89d2ccdae177d23076d336b6e2ecb25319a89859d154386ca41cdb
6
+ metadata.gz: 9295ad43adf6fb0ee295b275e25e6ee0c7e75ae6ee0cc6f077fc9e9e76d1a79d5f408c22104255ef4de8d83d89dbae06141bf5e8a8b10c55cd133931f1629a9e
7
+ data.tar.gz: 4508c8bcff6f12399ba312dbdb11cf35e10f007b26947c58a870430061ed7f851d0803a1373fa7f059c05e7fcabc8e192dcff13af8ab500cf564cbc4a0b448a4
@@ -9,19 +9,44 @@
9
9
  # the `default_ratings_paths` globs, which are used during analysis to determine
10
10
  # which files should be rated.
11
11
  #
12
- rubocop:
13
- image: codeclimate/codeclimate-rubocop
14
- description: A Ruby static code analyzer, based on the community Ruby style guide.
15
- community: false
16
- upgrade_languages:
17
- - Ruby
12
+ brakeman:
13
+ image: codeclimate/codeclimate-brakeman
14
+ description: Static analysis tool which checks Ruby on Rails applications for security vulnerabilities.
15
+ community: true
18
16
  enable_regexps:
19
17
  - \.rb$
20
18
  default_ratings_paths:
19
+ - "app/**"
21
20
  - "**.rb"
21
+ bundler-audit:
22
+ image: codeclimate/codeclimate-bundler-audit
23
+ description: Patch-level verification for Bundler.
24
+ community: false
25
+ upgrade_languages:
26
+ - Ruby
27
+ enable_regexps:
28
+ - ^Gemfile\.lock$
29
+ default_ratings_paths:
30
+ - Gemfile.lock
31
+ csslint:
32
+ image: codeclimate/codeclimate-csslint
33
+ description: Automated linting of Cascading Stylesheets.
34
+ community: false
35
+ enable_regexps:
36
+ - \.css$
37
+ default_ratings_paths:
38
+ - "**.css"
39
+ coffeelint:
40
+ image: codeclimate/codeclimate-coffeelint
41
+ description: A style checker for CoffeeScript.
42
+ community: false
43
+ enable_regexps:
44
+ - \.coffee$
45
+ default_ratings_paths:
46
+ - "**.coffee"
22
47
  duplication:
23
48
  image: codeclimate/codeclimate-duplication
24
- description: Structural duplication detection for Ruby, Python, JavaScript, and PHP
49
+ description: Structural duplication detection for Ruby, Python, JavaScript, and PHP.
25
50
  community: false
26
51
  enable_regexps:
27
52
  default_ratings_paths:
@@ -31,9 +56,21 @@ duplication:
31
56
  - javascript
32
57
  - python
33
58
  - php
59
+ eslint:
60
+ image: codeclimate/codeclimate-eslint
61
+ description: A JavaScript/JSX linting utility.
62
+ community: false
63
+ upgrade_languages:
64
+ - JavaScript
65
+ enable_regexps:
66
+ - \.js$
67
+ - \.jsx$
68
+ default_ratings_paths:
69
+ - "**.js"
70
+ - "**.jsx"
34
71
  gofmt:
35
72
  image: codeclimate/codeclimate-gofmt
36
- description: gofmt
73
+ description: Checks the formatting of Go programs.
37
74
  community: true
38
75
  enable_regexps:
39
76
  - \.go$
@@ -41,7 +78,7 @@ gofmt:
41
78
  - "**.go"
42
79
  golint:
43
80
  image: codeclimate/codeclimate-golint
44
- description: golint
81
+ description: A linter for Go.
45
82
  community: true
46
83
  enable_regexps:
47
84
  - \.go$
@@ -49,67 +86,36 @@ golint:
49
86
  - "**.go"
50
87
  govet:
51
88
  image: codeclimate/codeclimate-govet
52
- description: govet
89
+ description: Reports suspicious constructs in Go programs.
53
90
  community: true
54
91
  enable_regexps:
55
92
  - \.go$
56
93
  default_ratings_paths:
57
94
  - "**.go"
58
- coffeelint:
59
- image: codeclimate/codeclimate-coffeelint
60
- description: A style checker for CoffeeScript
61
- community: false
62
- enable_regexps:
63
- - \.coffee$
64
- default_ratings_paths:
65
- - "**.coffee"
66
- eslint:
67
- image: codeclimate/codeclimate-eslint
68
- description: A JavaScript/JSX linting utility
69
- community: false
70
- upgrade_languages:
71
- - JavaScript
72
- enable_regexps:
73
- - \.js$
74
- - \.jsx$
75
- default_ratings_paths:
76
- - "**.js"
77
- - "**.jsx"
78
- csslint:
79
- image: codeclimate/codeclimate-csslint
80
- description: Automated linting of Cascading Stylesheets
95
+ fixme:
96
+ image: codeclimate/codeclimate-fixme
97
+ description: Finds FIXME, TODO, HACK, etc. comments.
81
98
  community: false
82
99
  enable_regexps:
83
- - \.css$
84
- default_ratings_paths:
85
- - "**.css"
86
- watson:
87
- image: codeclimate/codeclimate-watson
88
- description: A young Ember Doctor to help you fix your code.
100
+ - .+
101
+ default_ratings_paths: []
102
+ foodcritic:
103
+ image: codeclimate/codeclimate-foodcritic
104
+ description: Lint tool for Chef cookbooks.
89
105
  community: true
90
106
  enable_regexps:
91
107
  default_ratings_paths:
92
- - "app/**"
93
- rubymotion:
94
- image: codeclimate/codeclimate-rubymotion
95
- description: Rubymotion-specific rubocop checks
108
+ pep8:
109
+ image: codeclimate/codeclimate-pep8
110
+ description: Static analysis tool to check Python code against the style conventions outlined in PEP-8.
96
111
  community: true
97
112
  enable_regexps:
113
+ - \.py$
98
114
  default_ratings_paths:
99
- - "**.rb"
100
- bundler-audit:
101
- image: codeclimate/codeclimate-bundler-audit
102
- description: Patch-level verification for Bundler
103
- community: false
104
- upgrade_languages:
105
- - Ruby
106
- enable_regexps:
107
- - ^Gemfile\.lock$
108
- default_ratings_paths:
109
- - Gemfile.lock
115
+ - "**.py"
110
116
  phpcodesniffer:
111
117
  image: codeclimate/codeclimate-phpcodesniffer
112
- description: PHP Code Sniffer
118
+ description: Detects violations of a defined set of coding standards in PHP.
113
119
  community: false
114
120
  upgrade_languages:
115
121
  - PHP
@@ -123,7 +129,7 @@ phpcodesniffer:
123
129
  - "**.inc"
124
130
  phpmd:
125
131
  image: codeclimate/codeclimate-phpmd
126
- description: PHP Mess Detector
132
+ description: A PHP static analysis tool.
127
133
  community: false
128
134
  upgrade_languages:
129
135
  - PHP
@@ -135,29 +141,48 @@ phpmd:
135
141
  - "**.php"
136
142
  - "**.module"
137
143
  - "**.inc"
138
- fixme:
139
- image: codeclimate/codeclimate-fixme
140
- description: Find FIXME, TODO, HACK, etc. comments
144
+ radon:
145
+ image: codeclimate/codeclimate-radon
146
+ description: Python tool used to compute Cyclomatic Complexity.
147
+ community: true
148
+ enable_regexps:
149
+ - \.py$
150
+ default_ratings_paths:
151
+ - "**.py"
152
+ requiresafe:
153
+ image: codeclimate/codeclimate-requiresafe
154
+ description: Security tool for Node.js dependencies.
155
+ community: true
156
+ enable_regexps:
157
+ default_ratings_paths:
158
+ rubocop:
159
+ image: codeclimate/codeclimate-rubocop
160
+ description: A Ruby static code analyzer, based on the community Ruby style guide.
141
161
  community: false
162
+ upgrade_languages:
163
+ - Ruby
142
164
  enable_regexps:
143
- - .+
144
- default_ratings_paths: []
145
- foodcritic:
146
- image: codeclimate/codeclimate-foodcritic
147
- description: Lint tool for Chef cookbooks
165
+ - \.rb$
166
+ default_ratings_paths:
167
+ - "**.rb"
168
+ rubymotion:
169
+ image: codeclimate/codeclimate-rubymotion
170
+ description: Rubymotion-specific rubocop checks.
148
171
  community: true
149
172
  enable_regexps:
150
173
  default_ratings_paths:
174
+ - "**.rb"
151
175
  scss-lint:
152
176
  image: codeclimate/codeclimate-scss-lint
153
- description: Configurable tool for writing clean and consistent SCSS
177
+ description: Configurable tool for writing clean and consistent SCSS.
154
178
  community: true
155
179
  enable_regexps:
156
180
  default_ratings_paths:
157
181
  - "**.scss"
158
- requiresafe:
159
- image: codeclimate/codeclimate-requiresafe
160
- description: Security tool for Node.js dependencies
182
+ watson:
183
+ image: codeclimate/codeclimate-watson
184
+ description: A young Ember Doctor to help you fix your code.
161
185
  community: true
162
186
  enable_regexps:
163
187
  default_ratings_paths:
188
+ - "app/**"
@@ -44,7 +44,7 @@ module CC
44
44
 
45
45
  def names_and_raw_engine_configs
46
46
  {}.tap do |ret|
47
- @config.engines.each do |name, raw_engine_config|
47
+ (@config.engines || {}).each do |name, raw_engine_config|
48
48
  if raw_engine_config.enabled? && @registry.key?(name)
49
49
  ret[name] = raw_engine_config
50
50
  end
@@ -17,6 +17,10 @@ module CC
17
17
  @engine_registry = engine_registry
18
18
  end
19
19
 
20
+ def can_generate?
21
+ true
22
+ end
23
+
20
24
  def eligible_engines
21
25
  return @eligible_engines if @eligible_engines
22
26
 
@@ -28,6 +32,10 @@ module CC
28
32
  end
29
33
  end
30
34
 
35
+ def errors
36
+ []
37
+ end
38
+
31
39
  def exclude_paths
32
40
  AUTO_EXCLUDE_PATHS.select { |path| filesystem.exist?(path) }
33
41
  end
@@ -9,13 +9,11 @@ module CC
9
9
 
10
10
  def run
11
11
  if !upgrade? && filesystem.exist?(CODECLIMATE_YAML)
12
- say "Config file .codeclimate.yml already present.\nTry running 'validate-config' to check configuration."
12
+ fatal "Config file .codeclimate.yml already present.\nTry running 'validate-config' to check configuration."
13
13
  elsif upgrade? && engines_enabled?
14
- say "--upgrade should not be used on a .codeclimate.yml configured for the Platform.\nTry running 'validate-config' to check configuration."
14
+ fatal "--upgrade should not be used on a .codeclimate.yml configured for the Platform.\nTry running 'validate-config' to check configuration."
15
15
  else
16
- create_codeclimate_yaml
17
- say "Config file .codeclimate.yml successfully #{config_generator.post_generation_verb}.\nEdit and then try running 'validate-config' to check configuration."
18
- create_default_configs
16
+ generate_config
19
17
  end
20
18
  end
21
19
 
@@ -25,6 +23,19 @@ module CC
25
23
  @args.include?("--upgrade")
26
24
  end
27
25
 
26
+ def generate_config
27
+ unless config_generator.can_generate?
28
+ config_generator.errors.each do |error|
29
+ $stderr.puts colorize("ERROR: #{error}", :red)
30
+ end
31
+ fatal "Cannot generate .codeclimate.yml: please address above errors."
32
+ end
33
+
34
+ create_codeclimate_yaml
35
+ say "Config file .codeclimate.yml successfully #{config_generator.post_generation_verb}.\nEdit and then try running 'validate-config' to check configuration."
36
+ create_default_configs
37
+ end
38
+
28
39
  def create_codeclimate_yaml
29
40
  config = CC::CLI::Config.new
30
41
 
@@ -3,8 +3,16 @@ require "cc/cli/config_generator"
3
3
  module CC
4
4
  module CLI
5
5
  class UpgradeConfigGenerator < ConfigGenerator
6
+ def can_generate?
7
+ errors.blank?
8
+ end
9
+
10
+ def errors
11
+ existing_yaml.errors
12
+ end
13
+
6
14
  def exclude_paths
7
- existing_yaml["exclude_paths"] || []
15
+ (existing_yaml.exclude_paths || []).map(&:to_s)
8
16
  end
9
17
 
10
18
  def post_generation_verb
@@ -23,11 +31,11 @@ module CC
23
31
  end
24
32
 
25
33
  def classic_languages
26
- @classic_languages ||= existing_yaml["languages"].reject { |_, v| !v }.map(&:first)
34
+ @classic_languages ||= existing_yaml.languages.reject { |_, v| !v }.map(&:first)
27
35
  end
28
36
 
29
37
  def existing_yaml
30
- @existing_yml ||= YAML.safe_load(File.read(CODECLIMATE_YAML))
38
+ @existing_yaml ||= CC::Yaml.parse(File.read(CODECLIMATE_YAML))
31
39
  end
32
40
  end
33
41
  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.11.0
4
+ version: 0.13.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: 2015-10-28 00:00:00.000000000 Z
11
+ date: 2015-11-04 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.3.0
53
+ version: 0.4.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.3.0
60
+ version: 0.4.0
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: faraday
63
63
  requirement: !ruby/object:Gem::Requirement