Skip to content

Commit 68bf056

Browse files
authored
Merge pull request #217 from mum4k/release-0-10-0
Release v0.10.0
2 parents b60c1c5 + fee34e8 commit 68bf056

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+3098
-425
lines changed

.travis.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ script:
88
- go get -t ./...
99
- go get -u golang.org/x/lint/golint
1010
- go test ./...
11-
- go test -race ./...
11+
- CGO_ENABLED=1 go test -race ./...
1212
- go vet ./...
1313
- diff -u <(echo -n) <(gofmt -d -s .)
1414
- diff -u <(echo -n) <(./internal/scripts/autogen_licences.sh .)
1515
- diff -u <(echo -n) <(golint ./...)
1616
after_success:
1717
- ./internal/scripts/coverage.sh
18+
env:
19+
global:
20+
- CGO_ENABLED=0

CHANGELOG.md

+26-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.10.0] - 5-Jun-2019
11+
12+
### Added
13+
14+
- Added `time.Duration` based `ValueFormatter` for the `LineChart` Y-axis labels.
15+
- Added round and suffix `ValueFormatter` for the `LineChart` Y-axis labels.
16+
- Added decimal and suffix `ValueFormatter` for the `LineChart` Y-axis labels.
17+
- Added a `container.SplitOption` that allows fixed size container splits.
18+
- Added `grid` functions that allow fixed size rows and columns.
19+
20+
### Changed
21+
22+
- The `LineChart` can format the labels on the Y-axis with a `ValueFormatter`.
23+
- The `SegmentDisplay` can now display dots and colons ('.' and ':').
24+
- The `Donut` widget now guarantees spacing between the donut and its label.
25+
- The continuous build on Travis CI now builds with cgo explicitly disabled to
26+
ensure both Termdash and its dependencies use pure Go.
27+
28+
### Fixed
29+
30+
- Lint issues found on the Go report card.
31+
- An internal library belonging to the `Text` widget was incorrectly passing
32+
`math.MaxUint32` as an int argument.
33+
1034
## [0.9.1] - 15-May-2019
1135

1236
### Fixed
@@ -271,7 +295,8 @@ identifiers shouldn't be used externally.
271295
- The Gauge widget.
272296
- The Text widget.
273297

274-
[unreleased]: https://github.com/mum4k/termdash/compare/v0.9.1...devel
298+
[unreleased]: https://github.com/mum4k/termdash/compare/v0.10.0...devel
299+
[0.10.0]: https://github.com/mum4k/termdash/compare/v0.9.1...v0.10.0
275300
[0.9.1]: https://github.com/mum4k/termdash/compare/v0.9.0...v0.9.1
276301
[0.9.0]: https://github.com/mum4k/termdash/compare/v0.8.0...v0.9.0
277302
[0.8.0]: https://github.com/mum4k/termdash/compare/v0.7.2...v0.8.0

container/container.go

+7
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,13 @@ func (c *Container) split() (image.Rectangle, image.Rectangle, error) {
171171
if err != nil {
172172
return image.ZR, image.ZR, err
173173
}
174+
if c.opts.splitFixed > DefaultSplitFixed {
175+
if c.opts.split == splitTypeVertical {
176+
return area.VSplitCells(ar, c.opts.splitFixed)
177+
}
178+
return area.HSplitCells(ar, c.opts.splitFixed)
179+
}
180+
174181
if c.opts.split == splitTypeVertical {
175182
return area.VSplit(ar, c.opts.splitPercent)
176183
}

container/container_test.go

+91
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,45 @@ func TestNew(t *testing.T) {
490490
},
491491
wantContainerErr: true,
492492
},
493+
{
494+
desc: "fails when both SplitFixed and SplitPercent are specified",
495+
termSize: image.Point{10, 10},
496+
container: func(ft *faketerm.Terminal) (*Container, error) {
497+
return New(
498+
ft,
499+
SplitHorizontal(
500+
Top(
501+
Border(linestyle.Light),
502+
),
503+
Bottom(
504+
Border(linestyle.Light),
505+
),
506+
SplitFixed(4),
507+
SplitPercent(20),
508+
),
509+
)
510+
},
511+
wantContainerErr: true,
512+
},
513+
{
514+
desc: "fails on SplitFixed less than -1",
515+
termSize: image.Point{10, 20},
516+
container: func(ft *faketerm.Terminal) (*Container, error) {
517+
return New(
518+
ft,
519+
SplitHorizontal(
520+
Top(
521+
Border(linestyle.Light),
522+
),
523+
Bottom(
524+
Border(linestyle.Light),
525+
),
526+
SplitFixed(-2),
527+
),
528+
)
529+
},
530+
wantContainerErr: true,
531+
},
493532
{
494533
desc: "empty container",
495534
termSize: image.Point{10, 10},
@@ -616,6 +655,32 @@ func TestNew(t *testing.T) {
616655
return ft
617656
},
618657
},
658+
{
659+
desc: "horizontal unequal split",
660+
termSize: image.Point{10, 20},
661+
container: func(ft *faketerm.Terminal) (*Container, error) {
662+
return New(
663+
ft,
664+
SplitHorizontal(
665+
Top(
666+
Border(linestyle.Light),
667+
),
668+
Bottom(
669+
Border(linestyle.Light),
670+
),
671+
SplitFixed(4),
672+
),
673+
)
674+
},
675+
want: func(size image.Point) *faketerm.Terminal {
676+
ft := faketerm.MustNew(size)
677+
cvs := testcanvas.MustNew(ft.Area())
678+
testdraw.MustBorder(cvs, image.Rect(0, 0, 10, 4))
679+
testdraw.MustBorder(cvs, image.Rect(0, 4, 10, 20))
680+
testcanvas.MustApply(cvs, ft)
681+
return ft
682+
},
683+
},
619684
{
620685
desc: "horizontal split, parent and children have borders",
621686
termSize: image.Point{10, 10},
@@ -742,6 +807,32 @@ func TestNew(t *testing.T) {
742807
return ft
743808
},
744809
},
810+
{
811+
desc: "vertical fixed splits",
812+
termSize: image.Point{20, 10},
813+
container: func(ft *faketerm.Terminal) (*Container, error) {
814+
return New(
815+
ft,
816+
SplitVertical(
817+
Left(
818+
Border(linestyle.Light),
819+
),
820+
Right(
821+
Border(linestyle.Light),
822+
),
823+
SplitFixed(4),
824+
),
825+
)
826+
},
827+
want: func(size image.Point) *faketerm.Terminal {
828+
ft := faketerm.MustNew(size)
829+
cvs := testcanvas.MustNew(ft.Area())
830+
testdraw.MustBorder(cvs, image.Rect(0, 0, 4, 10))
831+
testdraw.MustBorder(cvs, image.Rect(4, 0, 20, 10))
832+
testcanvas.MustApply(cvs, ft)
833+
return ft
834+
},
835+
},
745836
{
746837
desc: "vertical split, parent and children have borders",
747838
termSize: image.Point{10, 10},

0 commit comments

Comments
 (0)