File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -69,9 +69,15 @@ tidy: ## Update dependencies
69
69
clean : # # Clean up the build artifacts
70
70
$(Q ) rm -rf build
71
71
72
- lint : # # Run golangci-lint with all checks enabled (development purpose only)
72
+ lint-dev : # # Run golangci-lint with all checks enabled (development purpose only)
73
73
./hack/tests/check-lint.sh dev
74
74
75
+ lint-fix : # # Run golangci-lint automatically fix (development purpose only)
76
+ ./hack/tests/check-lint.sh fix
77
+
78
+ lint : # # Run golangci-lint with all checks enabled in the ci
79
+ ./hack/tests/check-lint.sh ci
80
+
75
81
# #############################
76
82
# Generate Artifacts #
77
83
# #############################
@@ -181,9 +187,8 @@ test: test-unit ## Run the tests
181
187
test-markdown test/markdown :
182
188
./hack/ci/marker
183
189
184
- test-sanity test/sanity : tidy build/operator-sdk
190
+ test-sanity test/sanity : tidy build/operator-sdk lint
185
191
./hack/tests/sanity-check.sh
186
- ./hack/tests/check-lint.sh ci
187
192
188
193
TEST_PKGS: =$(shell go list ./... | grep -v -P 'github.com/operator-framework/operator-sdk/(hack|test/e2e) ')
189
194
test-unit test/unit : # # Run the unit tests
Original file line number Diff line number Diff line change @@ -19,8 +19,17 @@ DEV_LINTERS=(
19
19
" --enable=gosec" # NOT add this one to CI since was defined that it should be optional for now at least.
20
20
)
21
21
22
+ # Some lint checks can be fixed automatically by using it.
23
+ FIX_LINTERS=(
24
+ " --fix"
25
+ )
26
+
22
27
subcommand=$1
23
28
case $subcommand in
29
+ " fix" )
30
+ header_text " Running lint check with automatically fix"
31
+ LINTERS=${FIX_LINTERS[@]}
32
+ ;;
24
33
" dev" )
25
34
# #todo(camilamacedo86): It should be removed when all linter checks be enabled
26
35
header_text " Checking the project with all linters (dev)"
You can’t perform that action at this time.
0 commit comments