Skip to content

Commit a036293

Browse files
Adiciona workflow para checar a formatação do código nos PRs
1 parent d771cf1 commit a036293

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/gofmt-check.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: GoFmt Check
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '**' # Escuta PRs para qualquer branch de destino
7+
8+
jobs:
9+
gofmt:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
# Configura o repositório
14+
- name: Checkout repository
15+
uses: actions/checkout@v3
16+
17+
# Configura o ambiente Go
18+
- name: Setup Go
19+
uses: actions/setup-go@v4
20+
with:
21+
go-version: '1.20' # Ajuste a versão do Go conforme necessário
22+
23+
# Executa o gofmt para verificar formatação
24+
- name: Run gofmt
25+
run: |
26+
gofmt -l .
27+
if [ "$(gofmt -l .)" != "" ]; then
28+
echo "⚠️ The following files need to be formatted:"
29+
gofmt -l .
30+
exit 1
31+
fi

0 commit comments

Comments
 (0)