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 +4 -4
- data/config/engines.yml +93 -68
- data/lib/cc/analyzer/engines_builder.rb +1 -1
- data/lib/cc/cli/config_generator.rb +8 -0
- data/lib/cc/cli/init.rb +16 -5
- data/lib/cc/cli/upgrade_config_generator.rb +11 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a802a87b63c111d67efe9d1663f178e29248ec13
|
4
|
+
data.tar.gz: 6d583607b2efdcc87ec46206a25147de6e1c3d0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9295ad43adf6fb0ee295b275e25e6ee0c7e75ae6ee0cc6f077fc9e9e76d1a79d5f408c22104255ef4de8d83d89dbae06141bf5e8a8b10c55cd133931f1629a9e
|
7
|
+
data.tar.gz: 4508c8bcff6f12399ba312dbdb11cf35e10f007b26947c58a870430061ed7f851d0803a1373fa7f059c05e7fcabc8e192dcff13af8ab500cf564cbc4a0b448a4
|
data/config/engines.yml
CHANGED
@@ -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
|
-
|
13
|
-
image: codeclimate/codeclimate-
|
14
|
-
description:
|
15
|
-
community:
|
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:
|
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:
|
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:
|
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
|
-
|
59
|
-
image: codeclimate/codeclimate-
|
60
|
-
description:
|
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
|
-
-
|
84
|
-
default_ratings_paths:
|
85
|
-
|
86
|
-
|
87
|
-
|
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
|
-
|
93
|
-
|
94
|
-
|
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
|
-
- "**.
|
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:
|
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
|
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
|
-
|
139
|
-
image: codeclimate/codeclimate-
|
140
|
-
description:
|
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
|
-
|
146
|
-
|
147
|
-
|
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
|
-
|
159
|
-
image: codeclimate/codeclimate-
|
160
|
-
description:
|
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
|
data/lib/cc/cli/init.rb
CHANGED
@@ -9,13 +9,11 @@ module CC
|
|
9
9
|
|
10
10
|
def run
|
11
11
|
if !upgrade? && filesystem.exist?(CODECLIMATE_YAML)
|
12
|
-
|
12
|
+
fatal "Config file .codeclimate.yml already present.\nTry running 'validate-config' to check configuration."
|
13
13
|
elsif upgrade? && engines_enabled?
|
14
|
-
|
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
|
-
|
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
|
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
|
34
|
+
@classic_languages ||= existing_yaml.languages.reject { |_, v| !v }.map(&:first)
|
27
35
|
end
|
28
36
|
|
29
37
|
def existing_yaml
|
30
|
-
@
|
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.
|
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-
|
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.
|
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.
|
60
|
+
version: 0.4.0
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: faraday
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|