Skip to content

Commit

Permalink
feat(ci): update linter config and add sync job
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Nov 1, 2024
1 parent cca527f commit d3e462e
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 22 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/lint-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: lint-sync
on:
schedule:
# every Sunday at midnight
- cron: "0 0 * * 0"
workflow_dispatch: # allows manual triggering

permissions:
contents: write
pull-requests: write

jobs:
lint:
uses: charmbracelet/meta/.github/workflows/lint-sync.yml@main
15 changes: 2 additions & 13 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,5 @@ on:
pull_request:

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ^1
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
# Optional: golangci-lint command line arguments.
args: --issues-exit-code=1
lint:
uses: charmbracelet/meta/.github/workflows/lint.yml@main
40 changes: 40 additions & 0 deletions .golangci-soft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
run:
tests: false
issues-exit-code: 0

issues:
include:
- EXC0001
- EXC0005
- EXC0011
- EXC0012
- EXC0013

max-issues-per-linter: 0
max-same-issues: 0

linters:
enable:
- exhaustive
- goconst
- godot
- godox
- mnd
- gomoddirectives
- goprintffuncname
- misspell
- nakedret
- nestif
- noctx
- nolintlint
- prealloc
- wrapcheck

# disable default linters, they are already enabled in .golangci.yml
disable:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- unused
11 changes: 2 additions & 9 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,14 @@ issues:
linters:
enable:
- bodyclose
- dupl
- exportloopref
- goconst
- godot
- godox
- gofumpt
- goimports
- goprintffuncname
- gosec
- misspell
- nolintlint
- prealloc
- nilerr
- revive
- rowserrcheck
- sqlclosecheck
- tparallel
- unconvert
- unparam
- whitespace

0 comments on commit d3e462e

Please sign in to comment.