4803199fc7db77790b61ab90d2d3046d39b1d74d

Author
Ayman Bagabas <ayman.bagabas@gmail.com>
Committer
Ayman Bagabas <ayman.bagabas@gmail.com>
Date

Message

feat(ci): new lint workflows and config

Diff

  1diff --git a/.github/workflows/lint-soft.yml b/.github/workflows/lint-soft.yml
  2deleted file mode 100644
  3index 826981bb38a0745b8e5df85559c11b310860522a..0000000000000000000000000000000000000000
  4--- a/.github/workflows/lint-soft.yml
  5+++ /dev/null
  6@@ -1,31 +0,0 @@
  7-name: lint-soft
  8-
  9-on:
 10-  push:
 11-    branches:
 12-      - "main"
 13-  pull_request:
 14-
 15-permissions:
 16-  contents: read
 17-  # Optional: allow read access to pull request. Use with `only-new-issues` option.
 18-  pull-requests: read
 19-
 20-jobs:
 21-  golangci:
 22-    name: lint-soft
 23-    runs-on: ubuntu-latest
 24-    steps:
 25-      - name: Install Go
 26-        uses: actions/setup-go@v5
 27-        with:
 28-          go-version: ^1
 29-
 30-      - uses: actions/checkout@v4
 31-      - name: golangci-lint
 32-        uses: golangci/golangci-lint-action@v6
 33-        with:
 34-          # Optional: golangci-lint command line arguments.
 35-          args: --config .golangci-soft.yml --issues-exit-code=0
 36-          # Optional: show only new issues if it's a pull request. The default value is `false`.
 37-          only-new-issues: true
 38diff --git a/.github/workflows/lint-sync.yml b/.github/workflows/lint-sync.yml
 39new file mode 100644
 40index 0000000000000000000000000000000000000000..ecf8580246f0165842891ee5f6e28992d15d68ff
 41--- /dev/null
 42+++ b/.github/workflows/lint-sync.yml
 43@@ -0,0 +1,14 @@
 44+name: lint-sync
 45+on:
 46+  schedule:
 47+    # every Sunday at midnight
 48+    - cron: "0 0 * * 0"
 49+  workflow_dispatch: # allows manual triggering
 50+
 51+permissions:
 52+  contents: write
 53+  pull-requests: write
 54+
 55+jobs:
 56+  lint:
 57+    uses: charmbracelet/meta/.github/workflows/lint-sync.yml@main
 58diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
 59index 2d40010b0ab328c0febcbeb6844d6ccb8e332eec..a1d6d0e5124114e47fb85180f0bd7701a0e87a35 100644
 60--- a/.github/workflows/lint.yml
 61+++ b/.github/workflows/lint.yml
 62@@ -1,31 +1,8 @@
 63 name: lint
 64-
 65 on:
 66   push:
 67-    branches:
 68-      - "main"
 69   pull_request:
 70 
 71-permissions:
 72-  contents: read
 73-  # Optional: allow read access to pull request. Use with `only-new-issues` option.
 74-  pull-requests: read
 75-
 76 jobs:
 77-  golangci:
 78-    name: lint
 79-    runs-on: ubuntu-latest
 80-    steps:
 81-      - name: Install Go
 82-        uses: actions/setup-go@v5
 83-        with:
 84-          go-version: ^1
 85-
 86-      - uses: actions/checkout@v4
 87-      - name: golangci-lint
 88-        uses: golangci/golangci-lint-action@v6
 89-        with:
 90-          # Optional: golangci-lint command line arguments.
 91-          #args:
 92-          # Optional: show only new issues if it's a pull request. The default value is `false`.
 93-          only-new-issues: true
 94+  lint:
 95+    uses: charmbracelet/meta/.github/workflows/lint.yml@main
 96diff --git a/.golangci-soft.yml b/.golangci-soft.yml
 97index 5f3cebfa38144c36846ea57bc58595657a2f1bf1..d325d4fcc68edf4df434e2a080ff51a60bbe8661 100644
 98--- a/.golangci-soft.yml
 99+++ b/.golangci-soft.yml
100@@ -1,6 +1,6 @@
101 run:
102   tests: false
103-  timeout: 5m
104+  issues-exit-code: 0
105 
106 issues:
107   include:
108@@ -37,5 +37,4 @@ linters:
109     - govet
110     - ineffassign
111     - staticcheck
112-    - typecheck
113     - unused
114diff --git a/.golangci.yml b/.golangci.yml
115index bf678591b8180fc182c4196cf0634740546791e5..d6789e014ca229336128f250ccf3bc43de18d15e 100644
116--- a/.golangci.yml
117+++ b/.golangci.yml
118@@ -1,6 +1,5 @@
119 run:
120   tests: false
121-  timeout: 5m
122 
123 issues:
124   include:
125@@ -16,12 +15,10 @@ issues:
126 linters:
127   enable:
128     - bodyclose
129-    - exportloopref
130     - gofumpt
131     - goimports
132     - gosec
133     - nilerr
134-    - predeclared
135     - revive
136     - rowserrcheck
137     - sqlclosecheck
138@@ -29,10 +26,3 @@ linters:
139     - unconvert
140     - unparam
141     - whitespace
142-
143-severity:
144-  default-severity: error
145-  rules:
146-    - linters:
147-        - revive
148-      severity: info