Skip to content

Deprecate other_locations in analyzer spec, to clarify vs. trace #66

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 2 additions & 19 deletions spec/analyzers/SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ We welcome your participation and appreciate your patience as we finalize the pl
- [Remediation points](#remediation-points)
- [Locations](#locations)
- [Positions](#positions)
- [Other Locations](#other-locations)
- [Contents](#contents)
- [Source code traces](#source-code-traces)
- [Packaging](#packaging)
Expand Down Expand Up @@ -153,6 +152,7 @@ An `issue` represents a single instance of a real or potential code problem, det
"categories": ["Complexity"],
"location": Location,
"other_locations": [Location],
"trace": Trace,
"remediation_points": 50000,
"severity": Severity,
"fingerprint": "abcd1234"
Expand All @@ -165,6 +165,7 @@ An `issue` represents a single instance of a real or potential code problem, det
* `content` -- **Optional**. A markdown snippet describing the issue, including deeper explanations and links to other resources.
* `categories` -- **Required**. At least one category indicating the nature of the issue being reported.
* `location` -- **Required**. A `Location` object representing the place in the source code where the issue was discovered.
* `other_locations` -- **Optional, deprecated.** _Use `trace` instead._ Other locations is an optional array of [`Location`](#locations) objects.
* `trace` -- **Optional.** A `Trace` object representing other interesting source code locations related to this issue.
* `remediation_points` -- **Optional**. An integer indicating a rough estimate of how long it would take to resolve the reported issue.
* `severity` -- **Optional**. A `Severity` string (`info`, `minor`, `major`, `critical`, or `blocker`) describing the potential impact of the issue found.
Expand Down Expand Up @@ -267,23 +268,6 @@ line of the file.

Offsets, however are 0-based. A Position of `{ "offset": 4 }` represents the _fifth_ character in the file. Importantly, the `offset` is from the beginning of the file, not the beginning of a line. Newline characters (and all characters) count when computing an offset.

### Other Locations

Other locations is an optional array of [Location](#locations) objects:

```json
"other_locations": [
{
"path": "foo.rb",
"lines": { "begin": 25, "end": 55 }
},
{
"path": "bar.rb",
"lines": { "begin": 20, "end": 50 }
}
]
```

### Contents

Content gives more information about the issue's check, including a description of the issue, how to fix it, and relevant links. They are expressed as a hash with a `body` key. The value of this key should be a [Markdown](http://daringfireball.net/projects/markdown/) document. For example:
Expand Down Expand Up @@ -320,7 +304,6 @@ An example trace:
}],
"stacktrace": true
}

```


Expand Down