Skip to content

Commit 5b2f442

Browse files
author
ABaldwinHunter
committed
Clarify usage of other_locations key
1 parent f0073bf commit 5b2f442

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

SPEC.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ The baseline remediation points value is 50,000, which is the time it takes to f
201201

202202
### Locations
203203

204-
Locations refer to ranges of a source code file. A Location contains a `path`, a source range, (expressed as `lines` or `positions`), and an optional array of `other_locations`. Here's an example location:
204+
Locations refer to ranges of a source code file. A Location contains a `path`, a source range, (expressed as `lines` or `positions`). Here's an example location:
205205

206206
```json
207207
{
@@ -266,6 +266,25 @@ line of the file.
266266

267267
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.
268268

269+
### Other locations
270+
271+
Other Locations is an optional array of location objects
272+
273+
```json
274+
{
275+
"other_locations": [
276+
{
277+
"path": "foo.rb",
278+
"lines": { "begin": 25, "end": 55 }
279+
},
280+
{
281+
"path": "bar.rb",
282+
"lines": { "begin": 20, "end": 50 }
283+
}
284+
]
285+
}
286+
287+
269288
### Contents
270289

271290
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:

0 commit comments

Comments
 (0)