goodcheck
goodcheck copied to clipboard
Add rule location in JSON output
Example
goodcheck.yml:
rules:
- id: disallow-standard-error
pattern:
- token: StandardError
glob: lib/**/*.rb
message: Disallow `StandardError`.
justification:
- When there is an unavoidable reason to use `StandardError`.
goodcheck check --format json lib/:
[
{
"rule_id": "disallow-standard-error",
"path": "lib/errors.rb",
"location": {
"start_line": 2,
"start_column": 16,
"end_line": 2,
"end_column": 29
},
"message": "Disallow `StandardError`.",
"justifications": [
"When there is an unavoidable reason to use `StandardError`."
],
"rule_location": { //<= new property
"uri": "file:///tmp/project/goodcheck.yml", // or https://some.host/shared/rules.yml
"line": 2
}
}
]
I agree :+1: