Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix builds #2

Merged
merged 6 commits into from
Apr 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,25 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.22'

- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...

golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
# from: https://github.com/marketplace/actions/run-golangci-lint
version: latest
20 changes: 20 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
linters:
enable:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- unused
- forbidigo

linters-settings:
forbidigo:
# Forbid the following identifiers (list of regexp).
# Default: ["^(fmt\\.Print(|f|ln)|print|println)$"]
forbid:
# Builtin function:
- ^print.*$
# Optional message that gets included in error reports.
- p: ^fmt\.Print.*$
msg: Do not commit print statements.
1 change: 1 addition & 0 deletions cmd/mod.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ func ModCommand() *cobra.Command {
return err
}

// nolint:forbidigo
fmt.Print(string(out))

return nil
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/can3p/sackmesser

go 1.22.0
go 1.22

require (
github.com/alecthomas/assert/v2 v2.8.1
Expand Down
2 changes: 2 additions & 0 deletions pkg/operations/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ var operations = map[string]Operation{
"del": Delete,
}

//nolint:govet
type Call struct {
Name string `@Ident`
Path []PathElement `"(" (@Ident | @String ) ( "." (@Ident | @String) )*`
Arguments []Argument `( "," @@ )* ")"`
}

//nolint:govet
type Argument struct {
Float *float64 ` @Float`
Int *int `| @Int`
Expand Down
5 changes: 2 additions & 3 deletions pkg/traverse/simpleyaml/simpleyaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package simpleyaml

import (
"fmt"
"gopkg.in/yaml.v3"
"reflect"
"strconv"

"gopkg.in/yaml.v3"

"github.com/can3p/sackmesser/pkg/traverse/types"
)

Expand Down Expand Up @@ -165,8 +166,6 @@ func (n *jnode) NodeType() types.NodeType {
return types.NodeTypeNull
}

fmt.Println(n.vType.Kind())

switch n.vType.Kind() {
case reflect.Bool:
return types.NodeTypeBool
Expand Down
Loading