Skip to content

Commit

Permalink
style: add .editorconfig and gofmt action to enforce code formatt…
Browse files Browse the repository at this point in the history
…ing rules
  • Loading branch information
BreCabral committed Sep 7, 2024
1 parent f0c40d1 commit 653e637
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = tab
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
20 changes: 20 additions & 0 deletions .github/workflows/gofmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Go Format Check

on: pull_request

jobs:
gofmt:
name: Verify Go Code Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v4
with:
go-version: '^1.20'

- run: |
gofmt -l .
if [ -n "$(gofmt -l .)" ]; then
echo "Go code is not properly formatted."
exit 1

0 comments on commit 653e637

Please sign in to comment.