lines-annotation

module
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2024 License: MIT

README

Lines Annotation

This library abstracts a general representation of code, which braces line coverage, block annotation and diff info.

Then, built on top of this representation, coverage info from different commits are able be merged together, which facilitates coverage inheritance.

Library Structure

The following packages define different operations on the annotation structure defined in package model:

  • load: load primitive annotations like diff changes
  • filter: filter based on criteria
  • map: map from one form to another, for example, prepend path to files
  • compute: compute derived annotations from primitvie annotations and other derived annotations

package model

Generalize annotation data structure.

This helps store and analyse annotation data unified.

In reality, it reduces table redundancy.

Why Lines Annoation?

I find there are dozens of representations of code coverage, e.g. xml in java, plain text in golang. They correspond to different language-specific structures, which makes it quite difficult to develop a general coverage review UI.

To address this issue, I've created this library, firstly used in golang, then expanded to js. It has been proven universal for common usage.

Usage

This project is used by xgo as core library to provide coverage report.

Directories

Path Synopsis
ast
fun
package load provides utilities to load primitive annotations, include: - Line Changes - Line Empty Mark
package load provides utilities to load primitive annotations, include: - Line Changes - Line Empty Mark
git
loadcov
package loadcov is a high level load function specifically for coverage
package loadcov is a high level load function specifically for coverage
package merge provides utilities to merge annotations together
package merge provides utilities to merge annotations together
package model provides *core* representations for different code structures.
package model provides *core* representations for different code structures.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL