feat(ci): new lint workflows and config

Ayman Bagabas created

Change summary

.github/workflows/lint-soft.yml | 31 -------------------------------
.github/workflows/lint-sync.yml | 14 ++++++++++++++
.github/workflows/lint.yml      | 27 ++-------------------------
.golangci-soft.yml              |  3 +--
.golangci.yml                   | 10 ----------
5 files changed, 17 insertions(+), 68 deletions(-)

Detailed changes

.github/workflows/lint-soft.yml 🔗

@@ -1,31 +0,0 @@
-name: lint-soft
-
-on:
-  push:
-    branches:
-      - "main"
-  pull_request:
-
-permissions:
-  contents: read
-  # Optional: allow read access to pull request. Use with `only-new-issues` option.
-  pull-requests: read
-
-jobs:
-  golangci:
-    name: lint-soft
-    runs-on: ubuntu-latest
-    steps:
-      - name: Install Go
-        uses: actions/setup-go@v5
-        with:
-          go-version: ^1
-
-      - uses: actions/checkout@v4
-      - name: golangci-lint
-        uses: golangci/golangci-lint-action@v6
-        with:
-          # Optional: golangci-lint command line arguments.
-          args: --config .golangci-soft.yml --issues-exit-code=0
-          # Optional: show only new issues if it's a pull request. The default value is `false`.
-          only-new-issues: true

.github/workflows/lint-sync.yml 🔗

@@ -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

.github/workflows/lint.yml 🔗

@@ -1,31 +1,8 @@
 name: lint
-
 on:
   push:
-    branches:
-      - "main"
   pull_request:
 
-permissions:
-  contents: read
-  # Optional: allow read access to pull request. Use with `only-new-issues` option.
-  pull-requests: read
-
 jobs:
-  golangci:
-    name: lint
-    runs-on: ubuntu-latest
-    steps:
-      - name: Install Go
-        uses: actions/setup-go@v5
-        with:
-          go-version: ^1
-
-      - uses: actions/checkout@v4
-      - name: golangci-lint
-        uses: golangci/golangci-lint-action@v6
-        with:
-          # Optional: golangci-lint command line arguments.
-          #args:
-          # Optional: show only new issues if it's a pull request. The default value is `false`.
-          only-new-issues: true
+  lint:
+    uses: charmbracelet/meta/.github/workflows/lint.yml@main

.golangci-soft.yml 🔗

@@ -1,6 +1,6 @@
 run:
   tests: false
-  timeout: 5m
+  issues-exit-code: 0
 
 issues:
   include:
@@ -37,5 +37,4 @@ linters:
     - govet
     - ineffassign
     - staticcheck
-    - typecheck
     - unused

.golangci.yml 🔗

@@ -1,6 +1,5 @@
 run:
   tests: false
-  timeout: 5m
 
 issues:
   include:
@@ -16,12 +15,10 @@ issues:
 linters:
   enable:
     - bodyclose
-    - exportloopref
     - gofumpt
     - goimports
     - gosec
     - nilerr
-    - predeclared
     - revive
     - rowserrcheck
     - sqlclosecheck
@@ -29,10 +26,3 @@ linters:
     - unconvert
     - unparam
     - whitespace
-
-severity:
-  default-severity: error
-  rules:
-    - linters:
-        - revive
-      severity: info