From 4803199fc7db77790b61ab90d2d3046d39b1d74d Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Wed, 5 Mar 2025 09:32:50 -0500 Subject: [PATCH] feat(ci): new lint workflows and config --- .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(-) delete mode 100644 .github/workflows/lint-soft.yml create mode 100644 .github/workflows/lint-sync.yml diff --git a/.github/workflows/lint-soft.yml b/.github/workflows/lint-soft.yml deleted file mode 100644 index 826981bb38a0745b8e5df85559c11b310860522a..0000000000000000000000000000000000000000 --- a/.github/workflows/lint-soft.yml +++ /dev/null @@ -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 diff --git a/.github/workflows/lint-sync.yml b/.github/workflows/lint-sync.yml new file mode 100644 index 0000000000000000000000000000000000000000..ecf8580246f0165842891ee5f6e28992d15d68ff --- /dev/null +++ b/.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 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2d40010b0ab328c0febcbeb6844d6ccb8e332eec..a1d6d0e5124114e47fb85180f0bd7701a0e87a35 100644 --- a/.github/workflows/lint.yml +++ b/.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 diff --git a/.golangci-soft.yml b/.golangci-soft.yml index 5f3cebfa38144c36846ea57bc58595657a2f1bf1..d325d4fcc68edf4df434e2a080ff51a60bbe8661 100644 --- a/.golangci-soft.yml +++ b/.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 diff --git a/.golangci.yml b/.golangci.yml index bf678591b8180fc182c4196cf0634740546791e5..d6789e014ca229336128f250ccf3bc43de18d15e 100644 --- a/.golangci.yml +++ b/.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