Added the index layer
To allow multiple reports from a given tool for the same line of the same file.
This commit is contained in:
parent
b38f65ecb3
commit
d7fac836c1
|
@ -1,6 +1,7 @@
|
|||
# Grand Unified Software Quality Tool: Wrappers
|
||||
|
||||
Wrappers are intended to produce unifiable output from the specific tools they wrap. This unifiable output as follows:
|
||||
Wrappers are intended to produce unifiable output from the specific tools
|
||||
they wrap. This unifiable output as follows:
|
||||
|
||||
1. `as-edn` output in the form of a sequence of maps, with keys as follows:
|
||||
* `column` (optional) the locus of the report within the line
|
||||
|
@ -12,23 +13,41 @@ Wrappers are intended to produce unifiable output from the specific tools they w
|
|||
2. `as-markdown` output in the form of human-readable markdown
|
||||
|
||||
|
||||
The full EDN structure is something like this, so that EDNs generated by separate tools can be read and deep-merged.
|
||||
The full EDN structure is something like this, so that EDNs generated by
|
||||
separate tools can be read and deep-merged.
|
||||
|
||||
```clojure
|
||||
{:file "pathname/of/file.clj"
|
||||
:lines
|
||||
{147
|
||||
{:cloverage
|
||||
(:line 147
|
||||
:column 0
|
||||
:severity :info
|
||||
:tool :cloverage
|
||||
:text "9 out of 10 forms covered"}
|
||||
{index
|
||||
(:line 147
|
||||
:column 0
|
||||
:severity :info
|
||||
:tool :cloverage
|
||||
:text "9 out of 10 forms covered"}}
|
||||
:kibit
|
||||
{:line 147
|
||||
:column 37
|
||||
:severity :warn
|
||||
:tool :kibit
|
||||
:text "Consider using: `(pos? q)` instead of: `(> q 0)`"}}}
|
||||
|
||||
{index
|
||||
{:line 147
|
||||
:column 37
|
||||
:severity :warn
|
||||
:tool :kibit
|
||||
:text "Consider using: `(pos? q)` instead of: `(> q 0)`"}}}}
|
||||
```
|
||||
|
||||
**NOTE THAT** in the above, `index` represents an index into the reports
|
||||
generated by the specified tool and is distinct *for that tool*. It is not
|
||||
nexecssarily distinct within the document across all tools. It is required
|
||||
because one individual tool may generate more than one report from the same
|
||||
line.
|
||||
|
||||
At present I am using numbers from the set of natural numbers, but it would
|
||||
equally be possible to compose a value using something like
|
||||
|
||||
```clojure
|
||||
(keyword (str tool-name "-" n))
|
||||
```
|
||||
|
||||
where `n` is a distinct number. *What matters* is that the index of any report
|
||||
SHALL BE unique for any given tool within a given EDN file.
|
||||
|
|
Loading…
Reference in a new issue