codeclimate 0.50.0 → 0.51.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: dd4c8958bcac33c8724b5583940424802c1d683d
4
- data.tar.gz: 4b31260ce204712769572ab2e275e08349dce264
3
+ metadata.gz: c1072d607caa3c1a7acc00c61511dd53795b45f0
4
+ data.tar.gz: ec693dac12fa9623d217660b74c95e33292d1512
5
5
  SHA512:
6
- metadata.gz: ca421b12ecec0b9d0546c54155af2f1ed2e5f1ba00711b9afbe517fb94be61cddb14772d022fd02681ee7578c89c15d3c6213ca0f47b33982b2047e5c75c4b9e
7
- data.tar.gz: 97af7808eacb1b4fd38a67437a855c26ba8544bd85b78bf9d1879722c1bdac2a205031377617c7798ad8b20cd92ace86bf1877ec55f39d537ce5a1634c0fa4d4
6
+ metadata.gz: c3149fafae4e5f09a6ed3624854338d35dae3ff21da06e7476296225c98f8e94df73b741b8552a4256dbfbba3f5d0c60d3077c6e342b26b8dcd3852bb02a0ba2
7
+ data.tar.gz: 8de6950128f83ac2fc937d37a59f961e936e7422849d94e48f7f254fb2ca7826e4a04aa70d6eac4bfb84f7171f7b6553d8e6c9e47f219bb52e5cca905416fab3
data/config/engines.yml CHANGED
@@ -41,6 +41,20 @@ bundler-audit:
41
41
  - ^Gemfile\.lock$
42
42
  default_ratings_paths:
43
43
  - Gemfile.lock
44
+ checks:
45
+ channels:
46
+ beta: codeclimate/checks:beta
47
+ description: Maintainability and reliability checks for PHP, Python, JS, and more.
48
+ community: false
49
+ default_ratings_paths:
50
+ - "**.js"
51
+ - "**.py"
52
+ - "**.php"
53
+ default_config:
54
+ languages:
55
+ - javascript
56
+ - python
57
+ - php
44
58
  checkstyle:
45
59
  channels:
46
60
  beta: codeclimate/codeclimate-checkstyle:beta
@@ -134,6 +148,7 @@ duplication:
134
148
  eslint:
135
149
  channels:
136
150
  stable: codeclimate/codeclimate-eslint
151
+ eslint-1: codeclimate/codeclimate-eslint:eslint-1
137
152
  eslint-2: codeclimate/codeclimate-eslint:eslint-2
138
153
  eslint-3: codeclimate/codeclimate-eslint:eslint-3
139
154
  description: A JavaScript/JSX linting utility.
@@ -146,6 +161,12 @@ eslint:
146
161
  default_ratings_paths:
147
162
  - "**.js"
148
163
  - "**.jsx"
164
+ config_files:
165
+ .eslintrc.yml:
166
+ - .eslintrc
167
+ - .eslintrc.js
168
+ - .eslintrc.json
169
+ - .eslintrc.yaml
149
170
  flog:
150
171
  channels:
151
172
  beta: codeclimate/codeclimate-flog:beta
@@ -0,0 +1,281 @@
1
+ ---
2
+ parserOptions:
3
+ sourceType: module
4
+ ecmaFeatures:
5
+ jsx: true
6
+
7
+ env:
8
+ amd: true
9
+ browser: true
10
+ es6: true
11
+ jquery: true
12
+ node: true
13
+
14
+ # http://eslint.org/docs/rules/
15
+ rules:
16
+ # Possible Errors
17
+ no-await-in-loop: off
18
+ no-cond-assign: error
19
+ no-console: off
20
+ no-constant-condition: error
21
+ no-control-regex: error
22
+ no-debugger: error
23
+ no-dupe-args: error
24
+ no-dupe-keys: error
25
+ no-duplicate-case: error
26
+ no-empty-character-class: error
27
+ no-empty: error
28
+ no-ex-assign: error
29
+ no-extra-boolean-cast: error
30
+ no-extra-parens: off
31
+ no-extra-semi: error
32
+ no-func-assign: error
33
+ no-inner-declarations:
34
+ - error
35
+ - functions
36
+ no-invalid-regexp: error
37
+ no-irregular-whitespace: error
38
+ no-negated-in-lhs: error
39
+ no-obj-calls: error
40
+ no-prototype-builtins: off
41
+ no-regex-spaces: error
42
+ no-sparse-arrays: error
43
+ no-template-curly-in-string: off
44
+ no-unexpected-multiline: error
45
+ no-unreachable: error
46
+ no-unsafe-finally: off
47
+ no-unsafe-negation: off
48
+ use-isnan: error
49
+ valid-jsdoc: off
50
+ valid-typeof: error
51
+
52
+ # Best Practices
53
+ accessor-pairs: error
54
+ array-callback-return: off
55
+ block-scoped-var: off
56
+ class-methods-use-this: off
57
+ complexity:
58
+ - error
59
+ - 6
60
+ consistent-return: off
61
+ curly: off
62
+ default-case: off
63
+ dot-location: off
64
+ dot-notation: off
65
+ eqeqeq: error
66
+ guard-for-in: error
67
+ no-alert: error
68
+ no-caller: error
69
+ no-case-declarations: error
70
+ no-div-regex: error
71
+ no-else-return: off
72
+ no-empty-function: off
73
+ no-labels:
74
+ - error
75
+ - allowLoop: true
76
+ allowSwitch: true
77
+ no-empty-pattern: error
78
+ no-eq-null: error
79
+ no-eval: error
80
+ no-extend-native: error
81
+ no-extra-bind: error
82
+ no-extra-label: off
83
+ no-fallthrough: error
84
+ no-floating-decimal: off
85
+ no-global-assign: off
86
+ no-implicit-coercion: off
87
+ no-implied-eval: error
88
+ no-invalid-this: off
89
+ no-iterator: error
90
+ no-labels:
91
+ - error
92
+ - allowLoop: true
93
+ allowSwitch: true
94
+ no-lone-blocks: error
95
+ no-loop-func: error
96
+ no-magic-number: off
97
+ no-multi-spaces: off
98
+ no-multi-str: off
99
+ no-native-reassign: error
100
+ no-new-func: error
101
+ no-new-wrappers: error
102
+ no-new: error
103
+ no-octal-escape: error
104
+ no-octal: error
105
+ no-param-reassign: off
106
+ no-proto: error
107
+ no-redeclare: error
108
+ no-restricted-properties: off
109
+ no-return-assign: error
110
+ no-return-await: off
111
+ no-script-url: error
112
+ no-self-assign: off
113
+ no-self-compare: error
114
+ no-sequences: off
115
+ no-throw-literal: off
116
+ no-unmodified-loop-condition: off
117
+ no-unused-expressions: error
118
+ no-unused-labels: off
119
+ no-useless-call: error
120
+ no-useless-concat: error
121
+ no-useless-escape: off
122
+ no-useless-return: off
123
+ no-void: error
124
+ no-warning-comments: off
125
+ no-with: error
126
+ prefer-promise-reject-errors: off
127
+ radix: error
128
+ require-await: off
129
+ vars-on-top: off
130
+ wrap-iife: error
131
+ yoda: off
132
+
133
+ # Strict
134
+ strict: off
135
+
136
+ # Variables
137
+ init-declarations: off
138
+ no-catch-shadow: error
139
+ no-delete-var: error
140
+ no-label-var: error
141
+ no-restricted-globals: off
142
+ no-shadow-restricted-names: error
143
+ no-shadow: off
144
+ no-undef-init: error
145
+ no-undef: off
146
+ no-undefined: off
147
+ no-unused-vars: off
148
+ no-use-before-define: off
149
+
150
+ # Node.js and CommonJS
151
+ callback-return: error
152
+ global-require: error
153
+ handle-callback-err: error
154
+ no-mixed-requires: off
155
+ no-new-require: off
156
+ no-path-concat: error
157
+ no-process-env: off
158
+ no-process-exit: error
159
+ no-restricted-modules: off
160
+ no-sync: off
161
+
162
+ # Stylistic Issues
163
+ array-bracket-spacing: off
164
+ block-spacing: off
165
+ brace-style: off
166
+ camelcase: off
167
+ capitalized-comments: off
168
+ comma-dangle:
169
+ - error
170
+ - never
171
+ comma-spacing: off
172
+ comma-style: off
173
+ computed-property-spacing: off
174
+ consistent-this: off
175
+ eol-last: off
176
+ func-call-spacing: off
177
+ func-name-matching: off
178
+ func-names: off
179
+ func-style: off
180
+ id-length: off
181
+ id-match: off
182
+ indent: off
183
+ jsx-quotes: off
184
+ key-spacing: off
185
+ keyword-spacing: off
186
+ line-comment-position: off
187
+ linebreak-style: off
188
+ lines-around-comment: off
189
+ lines-around-directive: off
190
+ max-depth: off
191
+ max-len: off
192
+ max-nested-callbacks: off
193
+ max-params: off
194
+ max-statements-per-line: off
195
+ max-statements:
196
+ - error
197
+ - 30
198
+ multiline-ternary: off
199
+ new-cap: off
200
+ new-parens: off
201
+ newline-after-var: off
202
+ newline-before-return: off
203
+ newline-per-chained-call: off
204
+ no-array-constructor: off
205
+ no-bitwise: off
206
+ no-continue: off
207
+ no-inline-comments: off
208
+ no-lonely-if: off
209
+ no-mixed-operators: off
210
+ no-mixed-spaces-and-tabs: off
211
+ no-multi-assign: off
212
+ no-multiple-empty-lines: off
213
+ no-negated-condition: off
214
+ no-nested-ternary: off
215
+ no-new-object: off
216
+ no-plusplus: off
217
+ no-restricted-syntax: off
218
+ no-spaced-func: off
219
+ no-tabs: off
220
+ no-ternary: off
221
+ no-trailing-spaces: off
222
+ no-underscore-dangle: off
223
+ no-unneeded-ternary: off
224
+ object-curly-newline: off
225
+ object-curly-spacing: off
226
+ object-property-newline: off
227
+ one-var-declaration-per-line: off
228
+ one-var: off
229
+ operator-assignment: off
230
+ operator-linebreak: off
231
+ padded-blocks: off
232
+ quote-props: off
233
+ quotes: off
234
+ require-jsdoc: off
235
+ semi-spacing: off
236
+ semi: off
237
+ sort-keys: off
238
+ sort-vars: off
239
+ space-before-blocks: off
240
+ space-before-function-paren: off
241
+ space-in-parens: off
242
+ space-infix-ops: off
243
+ space-unary-ops: off
244
+ spaced-comment: off
245
+ template-tag-spacing: off
246
+ unicode-bom: off
247
+ wrap-regex: off
248
+
249
+ # ECMAScript 6
250
+ arrow-body-style: off
251
+ arrow-parens: off
252
+ arrow-spacing: off
253
+ constructor-super: off
254
+ generator-star-spacing: off
255
+ no-class-assign: off
256
+ no-confusing-arrow: off
257
+ no-const-assign: off
258
+ no-dupe-class-members: off
259
+ no-duplicate-imports: off
260
+ no-new-symbol: off
261
+ no-restricted-imports: off
262
+ no-this-before-super: off
263
+ no-useless-computed-key: off
264
+ no-useless-constructor: off
265
+ no-useless-rename: off
266
+ no-var: off
267
+ object-shorthand: off
268
+ prefer-arrow-callback: off
269
+ prefer-const: off
270
+ prefer-destructuring: off
271
+ prefer-numeric-literals: off
272
+ prefer-rest-params: off
273
+ prefer-reflect: off
274
+ prefer-spread: off
275
+ prefer-template: off
276
+ require-yield: off
277
+ rest-spread-spacing: off
278
+ sort-imports: off
279
+ symbol-description: off
280
+ template-curly-spacing: off
281
+ yield-star-spacing: off
data/lib/cc/cli/init.rb CHANGED
@@ -74,27 +74,40 @@ module CC
74
74
 
75
75
  def create_default_engine_configs
76
76
  say "Generating default configuration for engines..."
77
- available_engine_configs.each do |config_path|
78
- file_name = File.basename(config_path)
79
- if filesystem.exist?(file_name)
80
- say "Skipping generating #{file_name} file (already exists)."
81
- else
82
- filesystem.write_path(file_name, File.read(config_path))
83
- success "Config file #{file_name} successfully generated."
77
+ available_engine_configs.each do |(engine_name, config_paths)|
78
+ engine = engine_registry[engine_name]
79
+ config_mapping = Hash.new { |_, k| [k] }.merge(engine.fetch("config_files", {}))
80
+
81
+ config_paths.each do |config_path|
82
+ generate_config(config_path, config_mapping[File.basename(config_path)])
84
83
  end
85
84
  end
86
85
  end
87
86
 
87
+ def generate_config(config_path, possible_names)
88
+ file_name = File.basename(config_path)
89
+ existing_files = possible_names.select do |f|
90
+ filesystem.exist? f
91
+ end
92
+ if existing_files.any?
93
+ say "Skipping generating #{file_name}, existing file(s) found: #{existing_files.join(", ")}"
94
+ else
95
+ filesystem.write_path(file_name, File.read(config_path))
96
+ success "Config file #{file_name} successfully generated."
97
+ end
98
+ end
99
+
88
100
  def available_engine_configs
89
101
  engines = existing_cc_config.engines || {}
90
102
  engine_names = engines.select { |_, config| config.enabled? }.keys
91
103
 
92
- all_paths = engine_names.flat_map do |engine_name|
93
- engine_directory = File.expand_path("../../../../config/#{engine_name}", __FILE__)
94
- Dir.glob("#{engine_directory}/*", File::FNM_DOTMATCH)
95
- end
96
- all_paths.reject do |path|
97
- %w[. ..].include?(File.basename(path))
104
+ engine_names.map do |engine_name|
105
+ engine_directory = File.expand_path("../../../config/#{engine_name}", __dir__)
106
+ [
107
+ engine_name,
108
+ Dir.glob("#{engine_directory}/*", File::FNM_DOTMATCH).
109
+ reject { |path| %w[. ..].include?(File.basename(path)) },
110
+ ]
98
111
  end
99
112
  end
100
113
 
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.50.0
4
+ version: 0.51.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-02-23 00:00:00.000000000 Z
11
+ date: 2017-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -162,7 +162,7 @@ files:
162
162
  - config/csslint/.csslintrc
163
163
  - config/engines.yml
164
164
  - config/eslint/.eslintignore
165
- - config/eslint/.eslintrc
165
+ - config/eslint/.eslintrc.yml
166
166
  - config/rubocop/.rubocop.yml
167
167
  - lib/cc/analyzer.rb
168
168
  - lib/cc/analyzer/composite_container_listener.rb
@@ -253,7 +253,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
253
253
  version: '0'
254
254
  requirements: []
255
255
  rubyforge_project:
256
- rubygems_version: 2.6.8
256
+ rubygems_version: 2.4.5
257
257
  signing_key:
258
258
  specification_version: 4
259
259
  summary: Code Climate CLI
@@ -1,213 +0,0 @@
1
- ecmaFeatures:
2
- modules: true
3
- jsx: true
4
-
5
- env:
6
- amd: true
7
- browser: true
8
- es6: true
9
- jquery: true
10
- node: true
11
-
12
- # http://eslint.org/docs/rules/
13
- rules:
14
- # Possible Errors
15
- comma-dangle: [2, never]
16
- no-cond-assign: 2
17
- no-console: 0
18
- no-constant-condition: 2
19
- no-control-regex: 2
20
- no-debugger: 2
21
- no-dupe-args: 2
22
- no-dupe-keys: 2
23
- no-duplicate-case: 2
24
- no-empty: 2
25
- no-empty-character-class: 2
26
- no-ex-assign: 2
27
- no-extra-boolean-cast: 2
28
- no-extra-parens: 0
29
- no-extra-semi: 2
30
- no-func-assign: 2
31
- no-inner-declarations: [2, functions]
32
- no-invalid-regexp: 2
33
- no-irregular-whitespace: 2
34
- no-negated-in-lhs: 2
35
- no-obj-calls: 2
36
- no-regex-spaces: 2
37
- no-sparse-arrays: 2
38
- no-unexpected-multiline: 2
39
- no-unreachable: 2
40
- use-isnan: 2
41
- valid-jsdoc: 0
42
- valid-typeof: 2
43
-
44
- # Best Practices
45
- accessor-pairs: 2
46
- block-scoped-var: 0
47
- complexity: [2, 6]
48
- consistent-return: 0
49
- curly: 0
50
- default-case: 0
51
- dot-location: 0
52
- dot-notation: 0
53
- eqeqeq: 2
54
- guard-for-in: 2
55
- no-alert: 2
56
- no-caller: 2
57
- no-case-declarations: 2
58
- no-div-regex: 2
59
- no-else-return: 0
60
- no-empty-label: 2
61
- no-empty-pattern: 2
62
- no-eq-null: 2
63
- no-eval: 2
64
- no-extend-native: 2
65
- no-extra-bind: 2
66
- no-fallthrough: 2
67
- no-floating-decimal: 0
68
- no-implicit-coercion: 0
69
- no-implied-eval: 2
70
- no-invalid-this: 0
71
- no-iterator: 2
72
- no-labels: 0
73
- no-lone-blocks: 2
74
- no-loop-func: 2
75
- no-magic-number: 0
76
- no-multi-spaces: 0
77
- no-multi-str: 0
78
- no-native-reassign: 2
79
- no-new-func: 2
80
- no-new-wrappers: 2
81
- no-new: 2
82
- no-octal-escape: 2
83
- no-octal: 2
84
- no-proto: 2
85
- no-redeclare: 2
86
- no-return-assign: 2
87
- no-script-url: 2
88
- no-self-compare: 2
89
- no-sequences: 0
90
- no-throw-literal: 0
91
- no-unused-expressions: 2
92
- no-useless-call: 2
93
- no-useless-concat: 2
94
- no-void: 2
95
- no-warning-comments: 0
96
- no-with: 2
97
- radix: 2
98
- vars-on-top: 0
99
- wrap-iife: 2
100
- yoda: 0
101
-
102
- # Strict
103
- strict: 0
104
-
105
- # Variables
106
- init-declarations: 0
107
- no-catch-shadow: 2
108
- no-delete-var: 2
109
- no-label-var: 2
110
- no-shadow-restricted-names: 2
111
- no-shadow: 0
112
- no-undef-init: 2
113
- no-undef: 0
114
- no-undefined: 0
115
- no-unused-vars: 0
116
- no-use-before-define: 0
117
-
118
- # Node.js and CommonJS
119
- callback-return: 2
120
- global-require: 2
121
- handle-callback-err: 2
122
- no-mixed-requires: 0
123
- no-new-require: 0
124
- no-path-concat: 2
125
- no-process-exit: 2
126
- no-restricted-modules: 0
127
- no-sync: 0
128
-
129
- # Stylistic Issues
130
- array-bracket-spacing: 0
131
- block-spacing: 0
132
- brace-style: 0
133
- camelcase: 0
134
- comma-spacing: 0
135
- comma-style: 0
136
- computed-property-spacing: 0
137
- consistent-this: 0
138
- eol-last: 0
139
- func-names: 0
140
- func-style: 0
141
- id-length: 0
142
- id-match: 0
143
- indent: 0
144
- jsx-quotes: 0
145
- key-spacing: 0
146
- linebreak-style: 0
147
- lines-around-comment: 0
148
- max-depth: 0
149
- max-len: 0
150
- max-nested-callbacks: 0
151
- max-params: 0
152
- max-statements: [2, 30]
153
- new-cap: 0
154
- new-parens: 0
155
- newline-after-var: 0
156
- no-array-constructor: 0
157
- no-bitwise: 0
158
- no-continue: 0
159
- no-inline-comments: 0
160
- no-lonely-if: 0
161
- no-mixed-spaces-and-tabs: 0
162
- no-multiple-empty-lines: 0
163
- no-negated-condition: 0
164
- no-nested-ternary: 0
165
- no-new-object: 0
166
- no-plusplus: 0
167
- no-restricted-syntax: 0
168
- no-spaced-func: 0
169
- no-ternary: 0
170
- no-trailing-spaces: 0
171
- no-underscore-dangle: 0
172
- no-unneeded-ternary: 0
173
- object-curly-spacing: 0
174
- one-var: 0
175
- operator-assignment: 0
176
- operator-linebreak: 0
177
- padded-blocks: 0
178
- quote-props: 0
179
- quotes: 0
180
- require-jsdoc: 0
181
- semi-spacing: 0
182
- semi: 0
183
- sort-vars: 0
184
- space-after-keywords: 0
185
- space-before-blocks: 0
186
- space-before-function-paren: 0
187
- space-before-keywords: 0
188
- space-in-parens: 0
189
- space-infix-ops: 0
190
- space-return-throw-case: 0
191
- space-unary-ops: 0
192
- spaced-comment: 0
193
- wrap-regex: 0
194
-
195
- # ECMAScript 6
196
- arrow-body-style: 0
197
- arrow-parens: 0
198
- arrow-spacing: 0
199
- constructor-super: 0
200
- generator-star-spacing: 0
201
- no-arrow-condition: 0
202
- no-class-assign: 0
203
- no-const-assign: 0
204
- no-dupe-class-members: 0
205
- no-this-before-super: 0
206
- no-var: 0
207
- object-shorthand: 0
208
- prefer-arrow-callback: 0
209
- prefer-const: 0
210
- prefer-reflect: 0
211
- prefer-spread: 0
212
- prefer-template: 0
213
- require-yield: 0