Skip to content

Commit 511bbf0

Browse files
authored
issue 152 - use user lang to print numbers (#269)
* chore: update golang lint * feat: new config `lang` to render numbers * feat: extract complexity
1 parent 295d12f commit 511bbf0

File tree

10 files changed

+384
-145
lines changed

10 files changed

+384
-145
lines changed

.github/workflows/golangci-lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ jobs:
2222
go-version: 1.19
2323
cache: false
2424
- name: golangci-lint
25-
uses: golangci/golangci-lint-action@v4
25+
uses: golangci/golangci-lint-action@v6
2626
with:
2727
version: latest

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
## [Unreleased]
1313

14+
### Added
15+
16+
- new config `lang` to allow setting the number format to be used when printing
17+
1418
## [v0.52.0] - 2024-06-02
1519

1620
### Added

internal/mocks/mock_Config.go

+82-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/mocks/simple_config.go

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package mocks
22

33
import (
44
"github.com/lucassabreu/clockify-cli/pkg/cmdutil"
5+
"golang.org/x/text/language"
56
)
67

78
// SimpleConfig is used to set configs for tests were changing the config or
@@ -22,6 +23,7 @@ type SimpleConfig struct {
2223
LogLevelValue string
2324
AllowArchivedTags bool
2425
SearchProjectWithClientsName bool
26+
LanguageTag language.Tag
2527
}
2628

2729
// IsSearchProjectWithClientsName defines if the project name for ID should
@@ -125,6 +127,14 @@ func (d *SimpleConfig) GetWorkWeekdays() []string {
125127
return d.WorkweekDays
126128
}
127129

130+
func (d *SimpleConfig) SetLanguage(l language.Tag) {
131+
d.LanguageTag = l
132+
}
133+
134+
func (d *SimpleConfig) Language() language.Tag {
135+
return d.LanguageTag
136+
}
137+
128138
func (*SimpleConfig) Get(_ string) interface{} {
129139
panic("should not call")
130140
}

0 commit comments

Comments
 (0)