Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "Lint"

on:
push:
branches:
- master
- main
paths-ignore:
- '*.md'
- 'docs/**'

pull_request:
types: [ opened, synchronize ]
paths-ignore:
- '*.md'
- 'docs/**'
branches:
- master
- main

jobs:
lint:
name: "Run linter"
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.25"

- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: latest
40 changes: 40 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
version: "2"
linters:
default: all
enable:
- bodyclose
- copyloopvar
- decorder
- errcheck
- forbidigo
- goconst
- gocritic
- govet
- ineffassign
- intrange
- misspell
- nestif
- nlreturn
- perfsprint
- predeclared
- staticcheck
- testifylint
- unparam
- unused
- wastedassign
- whitespace
- wrapcheck
exclusions:
generated: lax
paths:
- ./ws/mocks
- ./ocppj/mocks
- ./ocpp1.6_test/mocks
formatters:
settings:
goimports:
local-prefixes:
- github.com/lorenzodonini/ocpp-go
enable:
- gofmt
- goimports
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
test:
docker compose -f docker-compose.test.yaml up toxiproxy integration_test --abort-on-container-exit

lint:
golangci-lint run

format:
golangci-lint fmt
Loading