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
|
# 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:
|
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
|
* `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
|
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
|
```clojure
|
||||||
{:file "pathname/of/file.clj"
|
{:file "pathname/of/file.clj"
|
||||||
:lines
|
:lines
|
||||||
{147
|
{147
|
||||||
{:cloverage
|
{:cloverage
|
||||||
(:line 147
|
{index
|
||||||
:column 0
|
(:line 147
|
||||||
:severity :info
|
:column 0
|
||||||
:tool :cloverage
|
:severity :info
|
||||||
:text "9 out of 10 forms covered"}
|
:tool :cloverage
|
||||||
|
:text "9 out of 10 forms covered"}}
|
||||||
:kibit
|
:kibit
|
||||||
{:line 147
|
{index
|
||||||
:column 37
|
{:line 147
|
||||||
:severity :warn
|
:column 37
|
||||||
:tool :kibit
|
:severity :warn
|
||||||
:text "Consider using: `(pos? q)` instead of: `(> q 0)`"}}}
|
: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