-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Golang static checks and linting GitHub Actions #33
Comments
Hi @avinal |
Hi @avinal, I hope you're doing well! 👋 I wanted to update you on the progress for the "Static Checks and Linting" workflow. Currently, I've implemented it using the golangci-lint GitHub Action. There are two main approaches for this:
Here's the YML configuration for our "Static Checks and Linting" GitHub Action, designed using approach 1: # SPDX-FileCopyrightText: 2024 Divij Sharma <[email protected]>
# SPDX-License-Identifier: GPL-2.0-only
name: Static Checks and Linting
concurrency:
group: lint-${{ github.head_ref }}
cancel-in-progress: true
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
jobs:
golangci-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
check-latest: true
cache: true
- name: lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.51
It's important to note that before deploying this action, we need to take into account the existing errors in the code. I need assistance in deciding which approach (1 or 2) to use. Your insights are highly appreciated! |
I favor the 1st method. It will be a good starting point and later, if needed, we can switch to manual. |
I also agree with @avinal here. 1st approach will be a good start and if required, can switch to the manual approach. PS, the fix for |
Thank you, @GMishx! Moreover, I wanted to confirm if the proposed YML file for the action is acceptable, or if it requires any modifications. Please advise on that aspect. P.S. I will open a PR as soon as the codebase is error-free, and lint check doesn't fail during every run. |
Awesome! Also, the YAML file looks correct to me. |
Closed by #36 |
Configure and use https://github.com/golangci/golangci-lint-action for static checks and linting on pull requests and push.
The text was updated successfully, but these errors were encountered: