Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

formatter: json formatter should be native #45

Closed
Tracked by #399
azu opened this issue Feb 23, 2020 · 2 comments
Closed
Tracked by #399

formatter: json formatter should be native #45

azu opened this issue Feb 23, 2020 · 2 comments
Labels
Status: Proposal Request for comments Type: Bug Bug or Bug fixes

Comments

@azu
Copy link
Member

azu commented Feb 23, 2020

-f json is the result of textlint's format.
We should return secretlint results as json insteadof it.

Currently, @secretlint/formatter is wrapper of textlint's formatter #10
As soon as, json formatter will be replaced native formatter.
Because, json formatter present raw results data.

@azu azu added Type: Bug Bug or Bug fixes Status: Proposal Request for comments labels Feb 23, 2020
@azu
Copy link
Member Author

azu commented Jul 2, 2023

fixed in #527

@azu azu mentioned this issue Jul 2, 2023
7 tasks
@azu azu closed this as completed Jul 2, 2023
@azu
Copy link
Member Author

azu commented Jul 2, 2023

const before = [{
  "filePath": "[SNAPSHOT]/input.txt",
  "messages": [{
    "ruleId": "example",
    "index": 8,
    "line": 1,
    "column": 8,
    "range": [8, 14],
    "loc": {
      "start": { "line": 1, "column": 8 },
      "end": { "line": 1, "column": 14 },
    },
    "severity": 1,
    "message": "[message-id] warning found secret: SECRET",
    "data": { "ID": "SECRET" },
    "type": "lint",
  }, {
    "ruleId": "example",
    "index": 8,
    "line": 1,
    "column": 8,
    "range": [8, 14],
    "loc": {
      "start": { "line": 1, "column": 8 },
      "end": { "line": 1, "column": 14 },
    },
    "severity": 2,
    "message": "[message-id] error found secret: SECRET",
    "data": { "ID": "SECRET" },
    "type": "lint",
  }, {
    "ruleId": "parent > example",
    "index": 8,
    "line": 1,
    "column": 8,
    "range": [8, 14],
    "loc": {
      "start": { "line": 1, "column": 8 },
      "end": { "line": 1, "column": 14 },
    },
    "severity": 2,
    "message": "[message-id] error found secret: SECRET",
    "data": { "ID": "SECRET" },
    "type": "lint",
  }],
}, { "filePath": "[SNAPSHOT]/input.no-secret.txt", "messages": [] }];
const after = [{
  "filePath": "[SNAPSHOT]/input.txt",
  "sourceContent": "THIS IS SECRET SOURCE\n",
  "sourceContentType": "text",
  "messages": [{
    "data": { "ID": "SECRET" },
    "type": "message",
    "message": "warning found secret: SECRET",
    "messageId": "message-id",
    "range": [8, 14],
    "loc": {
      "start": { "line": 1, "column": 8 },
      "end": { "line": 1, "column": 14 },
    },
    "ruleId": "example",
    "severity": "warning",
  }, {
    "data": { "ID": "SECRET" },
    "type": "message",
    "message": "error found secret: SECRET",
    "messageId": "message-id",
    "range": [8, 14],
    "loc": {
      "start": { "line": 1, "column": 8 },
      "end": { "line": 1, "column": 14 },
    },
    "ruleId": "example",
    "severity": "error",
  }, {
    "data": { "ID": "SECRET" },
    "type": "message",
    "message": "error found secret: SECRET",
    "messageId": "message-id",
    "range": [8, 14],
    "loc": {
      "start": { "line": 1, "column": 8 },
      "end": { "line": 1, "column": 14 },
    },
    "ruleId": "example",
    "ruleParentId": "parent",
    "severity": "error",
  }],
}, {
  "filePath": "[SNAPSHOT]/input.no-secret.txt",
  "sourceContent": "THIS IS PUBLIC SOURCE\n",
  "sourceContentType": "text",
  "messages": [],
}];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Proposal Request for comments Type: Bug Bug or Bug fixes
Projects
None yet
Development

No branches or pull requests

1 participant