Skip to content

Commit

Permalink
reactivated gci and thelper
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronsky committed Apr 19, 2021
1 parent 9956f38 commit d09b23b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 0 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ linters:
- cyclop
- exhaustivestruct
- funlen
- gci
- gofumpt
- interfacer
- lll
- maligned
- scopelint
- testpackage
- thelper
- wrapcheck
3 changes: 2 additions & 1 deletion internal/client/assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ along with Cider. If not, see <http://www.gnu.org/licenses/>.

package client

// nolint: gosec
import (
"crypto/md5" // #nosec
"crypto/md5"
"fmt"
"io"
"os"
Expand Down
2 changes: 2 additions & 0 deletions internal/client/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ func (t *mockTransport) RoundTrip(req *http.Request) (*http.Response, error) {
}

func newTestAsset(t *testing.T, name string) *testAsset {
t.Helper()

var path = filepath.Join(t.TempDir(), name)

err := os.WriteFile(path, []byte("TEST"), 0600)
Expand Down
10 changes: 7 additions & 3 deletions internal/git/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,16 @@ import (
)

func newMockGit(t *testing.T, commands ...shelltest.Command) *Git {
t.Helper()

ctx := context.New(config.Project{})

return newMockGitWithContext(ctx, t, commands...)
return newMockGitWithContext(t, ctx, commands...)
}

func newMockGitWithContext(ctx *context.Context, t *testing.T, commands ...shelltest.Command) *Git {
func newMockGitWithContext(t *testing.T, ctx *context.Context, commands ...shelltest.Command) *Git {
t.Helper()

return &Git{
Shell: &shelltest.Shell{
T: t,
Expand Down Expand Up @@ -67,8 +71,8 @@ func TestSanitizeProcess(t *testing.T) {
ctx := context.New(config.Project{})
ctx.CurrentDirectory = "test"
client := newMockGitWithContext(
ctx,
t,
ctx,
shelltest.Command{Stdout: "true", Stderr: "false"},
shelltest.Command{ReturnCode: 1, Stdout: "true", Stderr: "false"},
)
Expand Down

0 comments on commit d09b23b

Please sign in to comment.