Skip to content
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

Golangci config and workflow #62

Merged
merged 12 commits into from
Jan 12, 2023

Conversation

Shofiya2003
Copy link
Collaborator

@Shofiya2003 Shofiya2003 commented Jan 9, 2023

Resolved linting errors in resent codebase and created a workflow for linting
image
closes #32

@Shofiya2003 Shofiya2003 requested a review from uzaxirr January 9, 2023 23:54
@Shofiya2003 Shofiya2003 force-pushed the golangci_config_and_workflow branch from b4b13f0 to eff6722 Compare January 10, 2023 00:33
@Shofiya2003
Copy link
Collaborator Author

the linting checks are failing as it cannot access the packages. will try to resolve them by today.
there are no errors due to the existing codebase

steps:
- uses: actions/setup-go@v3
with:
go-version: 1.17
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are using 1.19, could you bump the number

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

@@ -0,0 +1,2 @@
issues:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what this file will do?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.golangci.yml is a configuration file used by golangci-lint

It can be used to mold the linter as per our repo needs

Copy link
Member

@uzaxirr uzaxirr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM just make sure all the tests are passing

.github/workflows/golangci-lint.yml Outdated Show resolved Hide resolved
.github/workflows/golangci-lint.yml Outdated Show resolved Hide resolved
@Shofiya2003
Copy link
Collaborator Author

@uzaxirr i tried resolving the errors given by the golangci-lint actions, it cannot import packages. I tried to use go build before running golangci-lint after the build but no change, same import errors occur. But the errors do not appear when I run golangci-lint in my local version.

@uzaxirr
Copy link
Member

uzaxirr commented Jan 12, 2023

Hey @Shofiya2003
I suspect that this is happening due to incorrect GOPATH or incorrect module mode as it is working on your local and not in CI

@uzaxirr uzaxirr added the enhancement New feature or request label Jan 12, 2023
@uzaxirr
Copy link
Member

uzaxirr commented Jan 12, 2023

Hey @Shofiya2003
I fixed it for you, we have to use v1.46.2 of golangci-lint with 1.19 version of go and did some other changes as well.

Copy link
Member

@uzaxirr uzaxirr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging it now, Thanks for your contribution!

@uzaxirr uzaxirr merged commit 060becd into ZeStream:dev Jan 12, 2023
@Shofiya2003
Copy link
Collaborator Author

thanks a ton!
will see the changes and take them into account next time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lint the Codebase and Create CI/CD workflow for the same
3 participants