Skip to content

Commit e9c509b

Browse files
added makefile target for linting the code
Signed-off-by: Kartikay <[email protected]>
1 parent 05634fb commit e9c509b

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Makefile

+7-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,10 @@ unused-package-check:
1111
@tidy=$$(go mod tidy); \
1212
if [ -n "$${tidy}" ]; then \
1313
echo "go mod tidy checking failed!"; echo "$${tidy}"; echo; \
14-
fi
14+
fi
15+
.PHONY: format_and_lint
16+
format_and_lint:
17+
@echo "------------------"
18+
@echo "--> Formatting and linting the code"
19+
@echo "------------------"
20+
@bash scripts/lint-check.sh

scripts/lint-check.sh

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
find . -name '*.go' -type f -exec gofmt -s -w {} \;
2+
golangci-lint run --enable goimports --enable gofmt --timeout 10m

0 commit comments

Comments
 (0)