mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-19 18:48:03 +01:00
Makefile+github: add make fmt-check to check for formatting
This commit is contained in:
18
.github/workflows/main.yml
vendored
18
.github/workflows/main.yml
vendored
@@ -32,6 +32,24 @@ env:
|
|||||||
GO_VERSION: 1.18.2
|
GO_VERSION: 1.18.2
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
########################
|
||||||
|
# format code
|
||||||
|
########################
|
||||||
|
fmt-check:
|
||||||
|
name: check code format
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: git checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: setup go ${{ env.GO_VERSION }}
|
||||||
|
uses: actions/setup-go@v3
|
||||||
|
with:
|
||||||
|
go-version: '${{ env.GO_VERSION }}'
|
||||||
|
|
||||||
|
- name: fmt
|
||||||
|
run: make fmt-check
|
||||||
|
|
||||||
########################
|
########################
|
||||||
# RPC and mobile compilation check
|
# RPC and mobile compilation check
|
||||||
########################
|
########################
|
||||||
|
|||||||
4
Makefile
4
Makefile
@@ -258,6 +258,10 @@ fmt: $(GOIMPORTS_BIN)
|
|||||||
@$(call print, "Formatting source.")
|
@$(call print, "Formatting source.")
|
||||||
gofmt -l -w -s $(GOFILES_NOVENDOR)
|
gofmt -l -w -s $(GOFILES_NOVENDOR)
|
||||||
|
|
||||||
|
fmt-check: fmt
|
||||||
|
@$(call print, "Checking fmt results.")
|
||||||
|
if test -n "$$(git status --porcelain)"; then echo "code not formatted correctly, please run `make fmt` again!"; git status; git diff; exit 1; fi
|
||||||
|
|
||||||
lint: docker-tools
|
lint: docker-tools
|
||||||
@$(call print, "Linting source.")
|
@$(call print, "Linting source.")
|
||||||
$(DOCKER_TOOLS) golangci-lint run -v $(LINT_WORKERS)
|
$(DOCKER_TOOLS) golangci-lint run -v $(LINT_WORKERS)
|
||||||
|
|||||||
@@ -45,6 +45,9 @@ transaction](https://github.com/lightningnetwork/lnd/pull/6730).
|
|||||||
* [The `golangci-lint` tool was updated to
|
* [The `golangci-lint` tool was updated to
|
||||||
`v1.46.2`](https://github.com/lightningnetwork/lnd/pull/6731)
|
`v1.46.2`](https://github.com/lightningnetwork/lnd/pull/6731)
|
||||||
|
|
||||||
|
* Updated the github actions to use `make fmt-check` in its [build
|
||||||
|
process](https://github.com/lightningnetwork/lnd/pull/6853).
|
||||||
|
|
||||||
# Contributors (Alphabetical Order)
|
# Contributors (Alphabetical Order)
|
||||||
|
|
||||||
* Carla Kirk-Cohen
|
* Carla Kirk-Cohen
|
||||||
|
|||||||
Reference in New Issue
Block a user