Skip to content

Commit 71630d2

Browse files
Vitali CernomschiCCristi
Vitali Cernomschi
authored andcommitted
Add codeclimate integration (#246)
* Add codeclimate configs * Add codeclimate && fix ESLint issues * Fix all ESLint issues * Test codeclimate branch * Increase mocha version * Add pwd * Update hound config * Update path to run coverage-reporter * Enable jsdoc validation && fix jsdoc issues * Install instanbul-combine locally * Fix istanbul-combine install * Add deps for coverage reporter * Refactor coverage reporter to support non-micro-app structure * Update head script * Increase duplication mass * Change head bash * Update results * Fix console.debug becuase it doesn't exist in node * Enable duplication checks * Update badges * Fix indent for switch-case * Fix renaming for no-catch-shadow * Fix test to es6 * Add mocha to ESLint config * Update todo && fix code quality issues * Fix ESLint issues * Remove codacy deps * Add formatting to coverage.sh * Add codeclimate reporter to deps * Remove return after cb * Remove return after cb * Remove return after cb
1 parent c4d0b33 commit 71630d2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+1582
-562
lines changed

.codeclimate.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
engines:
3+
csslint:
4+
enabled: true
5+
duplication:
6+
enabled: true
7+
config:
8+
languages:
9+
javascript:
10+
mass_threshold: 650
11+
exclude_paths:
12+
- "**/tests"
13+
eslint:
14+
enabled: true
15+
channel: "eslint-2"
16+
fixme:
17+
enabled: true
18+
ratings:
19+
paths:
20+
- "**.css"
21+
- "**.inc"
22+
- "**.js"
23+
- "**.jsx"
24+
- "**.es6"
25+
- "**.module"
26+
exclude_paths:
27+
- "**/bin/"
28+
- "**/test/"
29+
- "**/tests/"
30+
- "**/tmp/"
31+
- "**/vendor/"
32+
- "**/coverage"
33+
- "**/dist"
34+
- "**/node_modules"
35+
- "**/packages"
36+
- ".idea/"
37+
- "**.spec.js"
38+
- "**.min.js"
39+
- "**.min.css"

.csslintrc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--exclude-exts=.min.css
2+
--ignore=adjoining-classes,box-model,ids,order-alphabetical,unqualified-attributes

.eslintignore

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
bin/**/*
2+
test/**/*
3+
**/test
4+
**/vendor
5+
tmp/**/*
6+
**.spec.js
7+
**.min.js
8+
**.min.css
9+
10+
# third party js file
11+
*.min.js
12+
13+
14+
## Directory-based project format:
15+
.idea/
16+
17+
# Generated folders and files
18+
**/.log
19+
**/.sass-cache
20+
**/.tmp
21+
**/coverage
22+
**/coverages
23+
**/design.doc.json
24+
**/dist
25+
**/node_modules
26+
**/npm-debug.log
27+
**/packages
28+
**/quality
29+
**/reports
30+
31+
# Dependency directory
32+
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
33+
**/node_modules
34+
35+
# Debug log from npm
36+
npm-debug.log
37+
38+
# Compiled libraries
39+
**/compile/
40+
**/lib.compiled/

.eslintrc

+236
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
eslintConfig:
2+
root: true
3+
4+
ecmaFeatures:
5+
modules: true
6+
jsx: true
7+
arrowFunctions: true,
8+
blockBindings: true,
9+
classes: true,
10+
defaultParams: true,
11+
12+
env:
13+
amd: true
14+
browser: true
15+
es6: true
16+
jquery: true
17+
node: true
18+
jasmine: true
19+
mocha: true
20+
21+
parserOptions:
22+
sourceType: module
23+
24+
# http://eslint.org/docs/rules/
25+
rules:
26+
# Possible Errors
27+
comma-dangle: [0, never]
28+
no-cond-assign: 2
29+
no-console: 0
30+
no-constant-condition: 2
31+
no-control-regex: 2
32+
no-debugger: 2
33+
no-dupe-args: 2
34+
no-dupe-keys: 2
35+
no-duplicate-case: 2
36+
no-empty: 2
37+
no-empty-character-class: 2
38+
no-ex-assign: 2
39+
no-extra-boolean-cast: 2
40+
no-extra-parens: 0
41+
no-extra-semi: 2
42+
no-func-assign: 2
43+
no-inner-declarations: [2, functions]
44+
no-invalid-regexp: 2
45+
no-irregular-whitespace: 2
46+
no-negated-in-lhs: 2
47+
no-obj-calls: 2
48+
no-regex-spaces: 2
49+
no-sparse-arrays: 2
50+
no-unexpected-multiline: 2
51+
no-unreachable: 2
52+
use-isnan: 2
53+
valid-jsdoc: [2, {requireParamDescription: false, requireReturn: false, requireReturnDescription: false}]
54+
valid-typeof: 2
55+
56+
# Best Practices
57+
accessor-pairs: 2
58+
block-scoped-var: 0
59+
# no even warning due to codeclimate shows it as error
60+
complexity: [0, 18]
61+
consistent-return: 0
62+
curly: 2
63+
default-case: 0
64+
dot-location: 0
65+
dot-notation: 0
66+
eqeqeq: 2
67+
guard-for-in: 2
68+
no-alert: 2
69+
no-caller: 2
70+
# no even warning due to codeclimate shows it as error
71+
no-case-declarations: 0
72+
no-div-regex: 2
73+
no-else-return: 0
74+
no-empty-label: 0
75+
no-empty-pattern: 2
76+
no-eq-null: 2
77+
no-eval: 2
78+
no-extend-native: 2
79+
no-extra-bind: 2
80+
no-fallthrough: 2
81+
no-floating-decimal: 0
82+
no-implicit-coercion: 0
83+
no-implied-eval: 2
84+
no-invalid-this: 0
85+
no-iterator: 2
86+
no-labels: 0
87+
no-lone-blocks: 2
88+
# no even warning due to codeclimate shows it as error
89+
no-loop-func: 0
90+
no-magic-number: 0
91+
no-multi-spaces: 0
92+
no-multi-str: 0
93+
no-native-reassign: 2
94+
no-new-func: 2
95+
no-new-wrappers: 2
96+
no-new: 2
97+
no-octal-escape: 2
98+
no-octal: 2
99+
no-proto: 2
100+
no-redeclare: 2
101+
no-return-assign: 2
102+
no-script-url: 2
103+
no-self-compare: 2
104+
no-sequences: 0
105+
no-throw-literal: 0
106+
# no even warning due to codeclimate shows it as error
107+
no-unused-expressions: 0
108+
no-useless-call: 2
109+
no-useless-concat: 2
110+
no-void: 2
111+
no-warning-comments: 0
112+
no-with: 2
113+
# no even warning due to codeclimate shows it as error
114+
radix: [0, "always"]
115+
vars-on-top: 0
116+
wrap-iife: 2
117+
yoda: 0
118+
119+
# Strict
120+
strict: [0, global]
121+
122+
# Variables
123+
init-declarations: 0
124+
# no even warning due to codeclimate shows it as error
125+
no-catch-shadow: 0
126+
no-delete-var: 2
127+
no-label-var: 2
128+
no-shadow-restricted-names: 2
129+
no-shadow: 0
130+
no-undef-init: 2
131+
no-undef: 2
132+
no-undefined: 2
133+
no-unused-vars: [2, {args: "none"}]
134+
no-use-before-define: 2
135+
136+
# Node.js and CommonJS
137+
# no even warning due to codeclimate shows it as error
138+
callback-return: 0
139+
global-require: 0
140+
handle-callback-err: 2
141+
no-mixed-requires: 0
142+
no-new-require: 0
143+
no-path-concat: 2
144+
no-process-exit: 0
145+
no-restricted-modules: 0
146+
no-sync: 0
147+
148+
# Stylistic Issues
149+
array-bracket-spacing: 0
150+
block-spacing: 0
151+
brace-style: 0
152+
camelcase: [0, {properties: "never"}]
153+
comma-spacing: 0
154+
comma-style: 0
155+
computed-property-spacing: 0
156+
consistent-this: 0
157+
eol-last: 2
158+
func-names: 0
159+
func-style: 0
160+
id-length: 0
161+
id-match: 0
162+
indent: [2, 2, { SwitchCase: 1 }]
163+
jsx-quotes: 0
164+
key-spacing: 0
165+
linebreak-style: 0
166+
lines-around-comment: 0
167+
max-depth: [2, 7]
168+
max-len: [2, 120, 2, {ignoreComments: true}]
169+
max-nested-callbacks: 0
170+
max-params: 0
171+
max-statements: [2, 50]
172+
new-cap: [2, {capIsNew: false}]
173+
new-parens: 0
174+
newline-after-var: 0
175+
no-array-constructor: 0
176+
no-bitwise: 0
177+
no-continue: 0
178+
no-inline-comments: 0
179+
no-lonely-if: 0
180+
no-mixed-spaces-and-tabs: 0
181+
no-multiple-empty-lines: 0
182+
no-negated-condition: 0
183+
no-nested-ternary: 0
184+
no-new-object: 0
185+
no-plusplus: 0
186+
no-restricted-syntax: 0
187+
no-spaced-func: 0
188+
no-ternary: 0
189+
no-trailing-spaces: 0
190+
no-underscore-dangle: 0
191+
no-unneeded-ternary: 0
192+
object-curly-spacing: 0
193+
one-var: 0
194+
operator-assignment: 0
195+
operator-linebreak: 0
196+
padded-blocks: 0
197+
quote-props: 0
198+
quotes: [2, single]
199+
require-jsdoc: 2
200+
semi-spacing: 0
201+
semi: 0
202+
sort-vars: 0
203+
space-after-keywords: 0
204+
space-before-blocks: 0
205+
space-before-function-paren: 0
206+
space-before-keywords: 0
207+
space-in-parens: 0
208+
space-infix-ops: 0
209+
space-return-throw-case: 0
210+
space-unary-ops: 0
211+
spaced-comment: 0
212+
wrap-regex: 0
213+
214+
# ECMAScript 6
215+
arrow-body-style: 0
216+
arrow-parens: 0
217+
arrow-spacing: 0
218+
constructor-super: 0
219+
generator-star-spacing: 0
220+
no-arrow-condition: 0
221+
no-class-assign: 0
222+
no-const-assign: 0
223+
no-dupe-class-members: 0
224+
no-this-before-super: 0
225+
no-var: 0
226+
object-shorthand: 0
227+
prefer-arrow-callback: 0
228+
prefer-const: 0
229+
prefer-reflect: 0
230+
prefer-spread: 0
231+
prefer-template: 0
232+
require-yield: 0
233+
234+
globals:
235+
DeepFramework: true
236+
angular: true

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ lib-cov
8787

8888
# Coverage directory used by tools like istanbul
8989
coverage
90+
coverages
9091
compile
9192

9293
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
@@ -110,4 +111,4 @@ npm-debug.log
110111
lib.compiled
111112
/tests/*
112113
config.gypi
113-
**/test/bin/helper/*.js
114+
**/test/bin/**/*.js

.hound.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
fail_on_violations: true
22

33
javascript:
4-
enabled: true
5-
ignore_file: .houndignore
6-
config_file: .jshintrc # Airbnb linter config taken from https://github.com/airbnb/javascript/blob/master/linters/jshintrc
4+
jshint:
5+
enabled: false
6+
eslint:
7+
enabled: true
8+
config_file: .eslintrc
9+
ignore_file: .eslintignore
710

811
### IGNORE THIS SECTION ###
912

.houndignore

-7
This file was deleted.

.jscsrc

-18
This file was deleted.

0 commit comments

Comments
 (0)