Releases: nochso/ctxerr
Releases · nochso/ctxerr
1.0.0
Added
- Global integer
DefaultContext
allows you to override the default amount of
context lines (default 0). - Function
NewFromPath(path string, region ctxerr.Region) (ctxerr.Ctx, error)
returns a new Ctx based on a path to an existing file. - Method
Ctx.Error()
implementing the error interface, replacingCtx.String()
. - Function
Parse(line string) (*Ctx, error)
parses typical linter output into
Ctx structs.
Returns errorErrNoMatch
when unlikely to be a linter error.- Currently supports output of
gometalinter
andnpm run lint
.
- Currently supports output of
- Command
ctx
enhances stdin with pretty errors and optional context.
Changed
- Exported Position (a Region consists of two position).
- Exported all fields of Ctx and Region.
- Proper handling of Region with zero columns. It is now treated as a full line.
Removed
- Methods of
Ctx
:WithPath
,WithContext
andWithHint
as they're now exported as fields. - Struct
Error
and methodCtx.ToError()
. Use the exportedErr
field ofCtx
instead.
Fixed
- Tabs are now properly handled when padding and pointing to regions.
- No more panic when pointing outside of the line (to the right).