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 make lint #417

Merged
merged 1 commit into from
Jun 7, 2023
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ build-validate-image:

.PHONY: lint
lint: build-validate-image
docker run --rm $(IMAGE_PREFIX)validate bash -c "golangci-lint run --config ./golangci.yml ./..."
docker run --rm $(IMAGE_PREFIX)validate bash -c "golangci-lint run --config ./.golangci.yml ./..."

.PHONY: check-license
check-license: build-validate-image
Expand Down
7 changes: 0 additions & 7 deletions loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -750,13 +750,6 @@ func resolveMaybeUnixPath(workingDir string, path string) string {
return filePath
}

func resolveSecretsPath(secret types.SecretConfig, workingDir string, lookupEnv template.Mapping) types.SecretConfig {
if !secret.External.External && secret.File != "" {
secret.File = resolveMaybeUnixPath(workingDir, secret.File)
}
return secret
}

// TODO: make this more robust
func expandUser(path string) string {
if strings.HasPrefix(path, "~") {
Expand Down
5 changes: 1 addition & 4 deletions loader/loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1901,10 +1901,7 @@ func TestComposeFileWithVersion(t *testing.T) {
config, err := loadYAMLWithEnv(string(b), env)
assert.NilError(t, err)

workingDir, err := os.Getwd()
assert.NilError(t, err)

expectedConfig := withVersionExampleConfig(workingDir, homeDir)
expectedConfig := withVersionExampleConfig()

sort.Slice(config.Services, func(i, j int) bool {
return config.Services[i].Name > config.Services[j].Name
Expand Down
6 changes: 3 additions & 3 deletions loader/with-version-struct_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ import (
"github.com/compose-spec/compose-go/types"
)

func withVersionExampleConfig(workingDir, homeDir string) *types.Config {
func withVersionExampleConfig() *types.Config {
return &types.Config{
Services: withVersionServices(workingDir, homeDir),
Services: withVersionServices(),
Networks: withVersionNetworks(),
Volumes: withVersionVolumes(),
}
}

func withVersionServices(workingDir, homeDir string) []types.ServiceConfig {
func withVersionServices() []types.ServiceConfig {
return []types.ServiceConfig{
{
Name: "web",
Expand Down
7 changes: 3 additions & 4 deletions schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,18 @@
package schema

import (
// Enable support for embedded static resources
_ "embed"
"fmt"
"strings"
"time"

"github.com/xeipuuv/gojsonschema"

// Enable support for embedded static resources
_ "embed"
)

type portsFormatChecker struct{}

func (checker portsFormatChecker) IsFormat(input interface{}) bool {
func (checker portsFormatChecker) IsFormat(_ interface{}) bool {
// TODO: implement this
return true
}
Expand Down