Skip to content

Commit

Permalink
Add code climate setting and coverage report
Browse files Browse the repository at this point in the history
  • Loading branch information
nhat-phan authored and Nhat Phan committed Mar 13, 2018
1 parent 3d66001 commit f30c6ad
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 8 deletions.
54 changes: 54 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
version: "2"
checks:
argument-count:
enabled: true
config:
threshold: 4
complex-logic:
enabled: true
config:
threshold: 4
file-lines:
enabled: true
config:
threshold: 300
method-complexity:
enabled: true
config:
threshold: 8
method-count:
enabled: true
config:
threshold: 30
method-lines:
enabled: true
config:
threshold: 30
nested-control-flow:
enabled: true
config:
threshold: 4
return-statements:
enabled: true
config:
threshold: 5
similar-code:
enabled: true
config:
threshold: #language-specific defaults. overrides affect all languages.
identical-code:
enabled: true
config:
threshold: #language-specific defaults. overrides affect all languages.
exclude_patterns:
- "config/"
- "db/"
- "dist/"
- "features/"
- "**/node_modules/"
- "script/"
- "**/spec/"
- "**/test/"
- "**/tests/"
- "**/vendor/"
- "**/*.d.ts"
11 changes: 9 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
env:
global:
- CC_TEST_REPORTER_ID=713e953819d7409a50a2284b59ea639bb5b186253c6c9b3c92d4b06e92e88aae
language: node_js
node_js:
- "lts/carbon"
Expand All @@ -8,10 +11,14 @@ jobs:
node_js: "node"
os: linux
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- npm run build || exit 1
- sleep 5
- ./cc-test-reporter before-build
after_success:
- npm run coverage
- 'cat ./coverage/lcov.info | coveralls'
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT

- stage: platform-test
node_js: "lts/carbon"
Expand All @@ -25,4 +32,4 @@ install:
- npm install

script:
- npm test
- npm run coverage
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "najs-facade",
"version": "1.1.0",
"version": "1.1.1",
"scripts": {
"build": "npm run build-ts && npm run tslint",
"build-ts": "tsc -d",
Expand Down Expand Up @@ -28,7 +28,7 @@
"types": "./dist/lib/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/najs-framework/najs.git"
"url": "https://github.com/najs-framework/najs-facade.git"
},
"author": {
"name": "Nhat Phan",
Expand All @@ -38,9 +38,6 @@
"engines": {
"node": ">=6.5"
},
"peerDependencies": {
"sinon": "^4.1.3"
},
"dependencies": {
"sinon": "^4.1.3"
},
Expand Down

0 comments on commit f30c6ad

Please sign in to comment.