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

Switch to using Golang CI Lint #2503

Open
phillebaba opened this issue May 14, 2024 · 0 comments
Open

Switch to using Golang CI Lint #2503

phillebaba opened this issue May 14, 2024 · 0 comments
Assignees
Labels
tech-debt 💳 Debt that the team has charged and needs to repay

Comments

@phillebaba
Copy link
Collaborator

Describe what should be investigated or refactored

Currently Revive is being used to lint Zarf. While it does have a lot of rules it does not integrate well with other linter projects. Golang CI Lint on the other hand wraps a lot of other linter projects with one of them being Revive. Switching linting tool would allow us to keep the existing linter rules while also expanding with more checks.

We should at minimum aim to enable the default linters in Golang CI Lint ontop of Revive.

  • errcheck
  • gosimple
  • govet
  • ineffassign
  • staticcheck
  • unused

Additional context

Golang CI Lint is already being used by uds-cli so we are not the first to use it.

https://github.com/defenseunicorns/uds-cli/blob/main/.golangci.yml

@phillebaba phillebaba added the tech-debt 💳 Debt that the team has charged and needs to repay label May 14, 2024
@phillebaba phillebaba self-assigned this May 14, 2024
Noxsios added a commit that referenced this issue May 15, 2024
## Description

This replaces revive with golang-ci-lint, and instead runs revive
through the aforementioned tool. Additionally it replaces the header
check script with the goheader linter. The benefit of this change is
that we can enable more linters along with revive in the future.

## Related Issue

Part of #2503 

## Checklist before merging

- [x] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/.github/CONTRIBUTING.md#developer-workflow)
followed

---------

Co-authored-by: Austin Abro <37223396+AustinAbro321@users.noreply.github.com>
Co-authored-by: razzle <harry@razzle.cloud>
AustinAbro321 pushed a commit that referenced this issue May 16, 2024
## Description

Adds testifylint and fixes any issues related to it.

## Related Issue

Part of #2503 
Depends on #2499 

## Checklist before merging

- [x] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/.github/CONTRIBUTING.md#developer-workflow)
followed
AustinAbro321 pushed a commit that referenced this issue May 20, 2024
## Description

This change enables the ineffassign linter and fixes the only complaint
by refactoring the select state filter.

## Related Issue

Part of #2503 
Depends on #2499 

## Checklist before merging

- [x] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/.github/CONTRIBUTING.md#developer-workflow)
followed
phillebaba added a commit that referenced this issue May 20, 2024
This change enables the ineffassign linter and fixes the only complaint
by refactoring the select state filter.

Part of #2503
Depends on #2499

- [x] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/.github/CONTRIBUTING.md#developer-workflow)
followed
phillebaba added a commit that referenced this issue May 20, 2024
This change enables the ineffassign linter and fixes the only complaint
by refactoring the select state filter.

Part of #2503
Depends on #2499

- [x] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/.github/CONTRIBUTING.md#developer-workflow)
followed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech-debt 💳 Debt that the team has charged and needs to repay
Projects
Status: No status
Development

No branches or pull requests

1 participant