0.5.2, linting, basic formatting tests, shrinkwrap

This commit is contained in:
Gregg Lind 2016-09-23 12:28:09 -05:00
Родитель 551e565fd9
Коммит 4c3f6989c5
4 изменённых файлов: 22 добавлений и 11 удалений

12
.eslintrc Normal file
Просмотреть файл

@ -0,0 +1,12 @@
extends: eslint:recommended
env:
node: true
es6: true
browser: true
rules:
comma-dangle: off
no-console: off
no-unused-vars: [error, { vars: all, args: none }]

2
.gitignore поставляемый
Просмотреть файл

@ -1,2 +1,4 @@
node_modules node_modules
npm-shrinkwrap.json
npm-shrinkwrap.json

Просмотреть файл

@ -7,10 +7,8 @@
var chalk = require("chalk"); var chalk = require("chalk");
var program = require("commander"); var program = require("commander");
var request = require("request");
var rp = require("request-promise"); var rp = require("request-promise");
var delay = require("timeout-as-promise"); var delay = require("timeout-as-promise");
var merge = require("merge");
var sprintf=require("sprintf-js").sprintf; var sprintf=require("sprintf-js").sprintf;
var util = require("util"); var util = require("util");
@ -307,7 +305,7 @@ function formatAnswer(reportData, url, scan, options) {
// rescore // rescore
var newScore = 100; var newScore = 100;
for (var k in scores) { for (k in scores) {
newScore += scores[k].score_modifier; newScore += scores[k].score_modifier;
} }
@ -362,7 +360,7 @@ class Observatory {
logger.info("go client: ", f.link("https://github.com/mozilla/tls-observatory")) logger.info("go client: ", f.link("https://github.com/mozilla/tls-observatory"))
logger.info("comment: %s", f.link("https://github.com/mozilla/observatory-cli/issues/5")) logger.info("comment: %s", f.link("https://github.com/mozilla/observatory-cli/issues/5"))
return return
}; }
// require site for everything else // require site for everything else
logger.error(f.error("no <site> given")); logger.error(f.error("no <site> given"));
@ -372,8 +370,6 @@ class Observatory {
let O = new Observatory(); let O = new Observatory();
var program = require("commander");
program program
.version(require("./package.json").version) .version(require("./package.json").version)
.description(util.format("cli for interacting with Mozilla HTTP Observatory \n\n %s", f.link(SITE_URL))) .description(util.format("cli for interacting with Mozilla HTTP Observatory \n\n %s", f.link(SITE_URL)))

Просмотреть файл

@ -1,7 +1,7 @@
{ {
"name": "observatory-cli", "name": "observatory-cli",
"description": "Command line client for Mozilla HTTP observatory service", "description": "Command line client for Mozilla HTTP observatory service",
"version": "0.5.1", "version": "0.5.2",
"author": "Gregg Lind <glind@mozilla.com>", "author": "Gregg Lind <glind@mozilla.com>",
"bin": { "bin": {
"observatory": "./index.js" "observatory": "./index.js"
@ -13,15 +13,15 @@
"chalk": "^1.1.3", "chalk": "^1.1.3",
"clim": "^1.1.1", "clim": "^1.1.1",
"commander": "^2.9.0", "commander": "^2.9.0",
"merge": "^1.2.0",
"request": "^2.74.0", "request": "^2.74.0",
"request-promise": "^4.1.1", "request-promise": "^4.1.1",
"sprintf-js": "^1.0.3", "sprintf-js": "^1.0.3",
"timeout-as-promise": "^1.0.0" "timeout-as-promise": "^1.0.0"
}, },
"devDependencies": { "devDependencies": {
"chai": "^3.5.0", "depcheck": "^0.6.4",
"mocha": "^3.0.2" "eslint": "^3.5.0",
"fixpack": "^2.3.1"
}, },
"homepage": "https://github.com/mozilla/observatory-cli#readme", "homepage": "https://github.com/mozilla/observatory-cli#readme",
"keywords": [ "keywords": [
@ -36,6 +36,7 @@
"url": "git+https://github.com/mozilla/observatory-cli.git" "url": "git+https://github.com/mozilla/observatory-cli.git"
}, },
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "prepublish": "npm shrinkwrap",
"test": "eslint '**.js' && depcheck && fixpack && echo OK"
} }
} }