Skip to content

Commit 48d0dca

Browse files
chore: add lint-fix target to makefile
1 parent 43d58e1 commit 48d0dca

File tree

3 files changed

+48
-21
lines changed

3 files changed

+48
-21
lines changed

Makefile

+8
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ lint: $(TOOLS_BIN)/golangci-lint
6161
@echo "==> Linting code with 'golangci-lint'..."
6262
@$(TOOLS_BIN)/golangci-lint run ./...
6363

64+
## lint: Lint code with golangci-lint.
65+
.PHONY: lint-fix
66+
lint-fix: $(TOOLS_BIN)/golangci-lint
67+
@echo "==> Linting and fixing code with 'golangci-lint'..."
68+
@$(TOOLS_BIN)/golangci-lint run --fix ./...
69+
70+
71+
6472
## test: Run all tests.
6573
.PHONY: test
6674
test:

application/server/constants.go

-21
This file was deleted.
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* © 2025 Snyk Limited
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package scans
18+
19+
import (
20+
"context"
21+
"testing"
22+
23+
"github.com/rs/zerolog"
24+
"github.com/stretchr/testify/require"
25+
26+
"github.com/snyk/go-application-framework/pkg/configuration"
27+
28+
"github.com/snyk/snyk-ls/internal/testsupport"
29+
)
30+
31+
func TestPreScanCommand_ExecutePreScanCommand(t *testing.T) {
32+
testsupport.NotOnWindows(t, "we call a posix file")
33+
logger := zerolog.New(zerolog.NewConsoleWriter(zerolog.ConsoleTestWriter(t)))
34+
conf := configuration.NewWithOpts(configuration.WithAutomaticEnv())
35+
cut := NewPreScanCommand(conf, "/bin/ls", logger)
36+
37+
err := cut.ExecutePreScanCommand(context.Background())
38+
39+
require.NoError(t, err)
40+
}

0 commit comments

Comments
 (0)