mirror of
https://github.com/anchore/syft.git
synced 2026-02-12 10:36:45 +01:00
add format make target (#1733)
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
parent
661d256b85
commit
05715489c4
@ -15,7 +15,7 @@ After cloning the following step can help you get setup:
|
|||||||
- this command `go run cmd/syft/main.go alpine:latest` will compile and run syft against `alpine:latest`
|
- this command `go run cmd/syft/main.go alpine:latest` will compile and run syft against `alpine:latest`
|
||||||
5. view the README or syft help output for more output options
|
5. view the README or syft help output for more output options
|
||||||
|
|
||||||
The main make tasks for common static analysis and testing are `lint`, `lint-fix`, `unit`, `integration`, and `cli`.
|
The main make tasks for common static analysis and testing are `lint`, `format`, `lint-fix`, `unit`, `integration`, and `cli`.
|
||||||
|
|
||||||
See `make help` for all the current make tasks.
|
See `make help` for all the current make tasks.
|
||||||
|
|
||||||
|
|||||||
12
Makefile
12
Makefile
@ -118,14 +118,18 @@ lint: ## Run gofmt + golangci lint checks
|
|||||||
$(eval MALFORMED_FILENAMES := $(shell find . | grep -e ':'))
|
$(eval MALFORMED_FILENAMES := $(shell find . | grep -e ':'))
|
||||||
@bash -c "[[ '$(MALFORMED_FILENAMES)' == '' ]] || (printf '\nfound unsupported filename characters:\n$(MALFORMED_FILENAMES)\n\n' && false)"
|
@bash -c "[[ '$(MALFORMED_FILENAMES)' == '' ]] || (printf '\nfound unsupported filename characters:\n$(MALFORMED_FILENAMES)\n\n' && false)"
|
||||||
|
|
||||||
.PHONY: lint-fix
|
.PHONY: format
|
||||||
lint-fix: ## Auto-format all source code + run golangci lint fixers
|
format: ## Auto-format all source code
|
||||||
$(call title,Running lint fixers)
|
$(call title,Running formatters)
|
||||||
gofmt -w -s .
|
gofmt -w -s .
|
||||||
$(GOIMPORTS_CMD) -w .
|
$(GOIMPORTS_CMD) -w .
|
||||||
$(LINT_CMD) --fix
|
|
||||||
go mod tidy
|
go mod tidy
|
||||||
|
|
||||||
|
.PHONY: lint-fix
|
||||||
|
lint-fix: format ## Auto-format all source code + run golangci lint fixers
|
||||||
|
$(call title,Running lint fixers)
|
||||||
|
$(LINT_CMD) --fix
|
||||||
|
|
||||||
.PHONY: check-licenses
|
.PHONY: check-licenses
|
||||||
check-licenses: ## Ensure transitive dependencies are compliant with the current license policy
|
check-licenses: ## Ensure transitive dependencies are compliant with the current license policy
|
||||||
$(call title,Checking for license compliance)
|
$(call title,Checking for license compliance)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user