Skip to content

Commit

Permalink
Protobuf linter
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandofcampos committed Aug 18, 2024
1 parent 07101bb commit bb4a31e
Show file tree
Hide file tree
Showing 30 changed files with 9,649 additions and 5,856 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/buf-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Buf Linter
on:
pull_request:
paths:
- '**.proto'
- '**/buf.yaml'
- '**/buf.lock'
permissions:
contents: read
pull-requests: write
jobs:
buf:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-action@v1
with:
input: 'x/emissions/proto'
format: true
lint: true
breaking: false
- uses: bufbuild/buf-action@v1
with:
input: 'x/mint/proto'
format: true
lint: true
breaking: false
36 changes: 3 additions & 33 deletions x/emissions/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,6 @@

DOCKER := $(shell which docker)

#################
### Build ###
#################

build:
@echo "--> Check the code compiles"
@go build ./...

test:
@echo "--> Running tests"
go test -v ./...

.PHONY: test test-integration

##################
### Protobuf ###
##################
Expand All @@ -38,23 +24,7 @@ proto-format:
proto-lint:
@$(protoImage) buf lint proto/ --error-format=json

.PHONY: proto-all proto-gen proto-format proto-lint

#################
### Linting ###
#################

golangci_lint_cmd=golangci-lint
golangci_version=v1.51.2

lint:
@echo "--> Running linter"
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version)
@$(golangci_lint_cmd) run ./... --timeout 15m

lint-fix:
@echo "--> Running linter and fixing issues"
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version)
@$(golangci_lint_cmd) run ./... --fix --timeout 15m
proto-check-breaking:
@$(protoImage) buf breaking proto/ --against $(HTTPS_GIT)#branch=main

.PHONY: lint lint-fix
.PHONY: proto-all proto-gen proto-format proto-lint proto-check-breaking
43 changes: 20 additions & 23 deletions x/emissions/api/v3/inference.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit bb4a31e

Please sign in to comment.