From 8b8971b8cc3613c765fdda626b5c28cd058b1289 Mon Sep 17 00:00:00 2001 From: aaron-congo Date: Thu, 22 Feb 2024 13:21:03 -0800 Subject: [PATCH] Change editorconfig defaults for Go --- .editorconfig | 5 +++++ .github/workflows/go.yml | 4 ++-- go/Makefile | 6 ++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.editorconfig b/.editorconfig index abcc626724..5e97d9f629 100644 --- a/.editorconfig +++ b/.editorconfig @@ -15,6 +15,11 @@ indent_size = 2 # C# files [*.cs] +[*.go] +indent_style = tab +indent_size = 8 +tab_width = 8 + #### Core EditorConfig Options #### # Indentation and spacing diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 1aa200f75c..c16707c2a4 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -81,7 +81,7 @@ jobs: - name: Run linters working-directory: ./go - run: make lint + run: make lint-ci - name: Run tests working-directory: ./go @@ -162,7 +162,7 @@ jobs: - name: Run linters working-directory: ./go - run: make lint + run: make lint-ci - name: Run tests working-directory: ./go diff --git a/go/Makefile b/go/Makefile index f6cb527aab..6ae7aa825a 100644 --- a/go/Makefile +++ b/go/Makefile @@ -37,6 +37,12 @@ generate-protobuf: ../glide-core/src/protobuf/*.proto lint: + go vet ./... + staticcheck ./... + gofumpt -d . + golines --dry-run --shorten-comments -m 127 . + +lint-ci: go vet ./... staticcheck ./... if [ "$$(gofumpt -l . | wc -l)" -gt 0 ]; then exit 1; fi