Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add a Go linter to CI #28

Merged
merged 7 commits into from
Sep 12, 2023
Merged

Add a Go linter to CI #28

merged 7 commits into from
Sep 12, 2023

Conversation

gwen917
Copy link
Contributor

@gwen917 gwen917 commented Sep 6, 2023

Why this should be merged

  • Add a linter for go files with set lint rules and a github workflow.

How this works

How this was tested

  • CI

@gwen917 gwen917 marked this pull request as ready for review September 6, 2023 15:08
@gwen917 gwen917 linked an issue Sep 6, 2023 that may be closed by this pull request
# Copyright (C) 2023, Ava Labs, Inc. All rights reserved.
# See the file LICENSE for licensing terms.

set -o errexit

Choose a reason for hiding this comment

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

can you add a comment about what these do

Copy link

@minghinmatthewlam minghinmatthewlam left a comment

Choose a reason for hiding this comment

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

Mostly LGTM matches what I see in other company lint configs, nit for comment and adding back createUnsignedMessage

Comment on lines +6 to +9
on:
push:
branches:
- '*'
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should run this in the same way as most of our other checks - on all PRs and also pushes to main.

Copy link
Contributor Author

@gwen917 gwen917 Sep 11, 2023

Choose a reason for hiding this comment

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

Does this not check all PRs and push to main? The test.yml did the same.

Copy link
Contributor

Choose a reason for hiding this comment

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

It does, but it also checks every push to any branch even if it is not contained in a PR. The general idea is to limit the load on the CI servers by only checking a PRs, because branches probably don't need checks before that.

Copy link
Contributor Author

@gwen917 gwen917 Sep 12, 2023

Choose a reason for hiding this comment

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

Discussed during the standup yesterday. The lint is light weighted. It should should be fine running for every push.

Copy link
Collaborator

@cam-schultz cam-schultz left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@bernard-avalabs bernard-avalabs left a comment

Choose a reason for hiding this comment

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

LGTM

@gwen917 gwen917 merged commit aaa13db into main Sep 12, 2023
@gwen917 gwen917 deleted the golang-linter branch September 12, 2023 20:48
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add a Go linter to CI
5 participants