Skip to content

Commit

Permalink
ci: enables gofmt linter of golangci
Browse files Browse the repository at this point in the history
  • Loading branch information
lufia committed Feb 27, 2024
1 parent 15310ca commit b154eea
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ jobs:
convention:
uses: mackerelio/workflows/.github/workflows/setup-go-matrix.yml@v1.1.0
with:
run: |
make convention
# TODO: use gofmt linter
test "$(gofmt -l . | wc -l)" -eq 0
run: make convention
test:
uses: mackerelio/workflows/.github/workflows/go-test.yml@v1.1.0
with:
Expand Down
6 changes: 6 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
linters:
enable:
- gofmt
linters-settings:
gofmt:
simplify: true
issues:
exclude-rules:
- path: _test\.go
Expand Down
4 changes: 2 additions & 2 deletions command/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,10 @@ func TestCollectHostParamWithChecks(t *testing.T) {
customIdentifier := "app.example.com"
conf := config.Config{
CheckPlugins: map[string]*config.CheckPlugin{
"chk1": &config.CheckPlugin{
"chk1": {
CustomIdentifier: nil,
},
"chk2": &config.CheckPlugin{
"chk2": {
CustomIdentifier: &customIdentifier,
},
},
Expand Down
4 changes: 2 additions & 2 deletions metrics/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (g *AgentGenerator) CustomIdentifier() *string {
func (g *AgentGenerator) PrepareGraphDefs() ([]*mkr.GraphDefsParam, error) {
meta := &pluginMeta{
Graphs: map[string]customGraphDef{
"agent.memory": customGraphDef{
"agent.memory": {
Label: "Agent Memory",
Unit: "bytes",
Metrics: []customGraphMetricDef{
Expand All @@ -47,7 +47,7 @@ func (g *AgentGenerator) PrepareGraphDefs() ([]*mkr.GraphDefsParam, error) {
{Name: "heapSys", Label: "Heap Sys"},
},
},
"agent.runtime": customGraphDef{
"agent.runtime": {
Label: "Agent Runtime",
Unit: "integer",
Metrics: []customGraphMetricDef{
Expand Down

0 comments on commit b154eea

Please sign in to comment.