Skip to content

Commit

Permalink
Print formatted JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
jdkato committed Jun 21, 2020
1 parent 2c4a0b9 commit 932392f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions lib/check.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.CheckRunner = void 0;
const core = __importStar(require("@actions/core"));
const github = __importStar(require("@actions/github"));
const colorize = require('json-colorizer');
const pkg = require('../package.json');
const USER_AGENT = `${pkg.name}/${pkg.version} (${pkg.bugs.url})`;
/**
Expand Down Expand Up @@ -241,7 +240,7 @@ class CheckRunner {
* TODO: Nicer formatting?
*/
dumpToStdout() {
console.log(colorize(JSON.stringify(this.annotations)));
console.dir(this.annotations, { depth: null, colors: true });
}
/**
* Create buckets of at most 50 annotations for the API.
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"@types/request-promise-native": "^1.0.17",
"@types/tmp": "^0.1.0",
"execa": "^3.2.0",
"json-colorizer": "^2.2.2",
"request": "^2.88.0",
"request-promise-native": "^1.0.7",
"tmp": "^0.1.0"
Expand Down
3 changes: 1 addition & 2 deletions src/check.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as core from '@actions/core';
import * as github from '@actions/github';

const colorize = require('json-colorizer');
const pkg = require('../package.json');
const USER_AGENT = `${pkg.name}/${pkg.version} (${pkg.bugs.url})`;

Expand Down Expand Up @@ -260,7 +259,7 @@ export class CheckRunner {
* TODO: Nicer formatting?
*/
private dumpToStdout() {
console.log(colorize(JSON.stringify(this.annotations)));
console.dir(this.annotations, {depth: null, colors: true})
}

/**
Expand Down

0 comments on commit 932392f

Please sign in to comment.