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

Initial Lint Support #1055

Merged
merged 5 commits into from
Oct 9, 2023
Merged

Conversation

shubhindia
Copy link
Contributor

Problem

There are no lint checks in place currently.

Solution

This PR adds golangci-lint support. The lint checks are done via github-actions only.

Changes Made

  • Added lint.yml for golangci-lint runs
  • Fixed some lint errors as well

How to Test

  • to run linter, run golangci-lint run
  • to star komiser, run komiser start --config=config.toml

Checklist

  • Code follows the contributing guidelines
  • Changes have been thoroughly tested
  • Documentation has been updated, if necessary
  • Any dependencies have been added to the project, if necessary

Signed-off-by: shubhindia <shubhindia123@gmail.com>
Signed-off-by: shubhindia <shubhindia123@gmail.com>
Signed-off-by: shubhindia <shubhindia123@gmail.com>
Copy link
Collaborator

@Azanul Azanul left a comment

Choose a reason for hiding this comment

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

Good work! I've left a couple of suggestions for consideration.

.github/workflows/lint.yml Outdated Show resolved Hide resolved
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
args: --timeout=30m
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
args: --timeout=30m
args: --timeout=2m
version: v1.54

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will fail with timeout error. Clean lint check takes around 140s on my M1 Pro Macbook. Currently it takes around 6 mins to run in GA ref: https://github.com/shubhindia/komiser/actions/runs/6454534229

Copy link
Contributor Author

@shubhindia shubhindia Oct 9, 2023

Choose a reason for hiding this comment

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

Reduced the timeout to 10mins now. It would be much faster with cache, but 10 mins is a reasonable time to run lint I think.

shubhindia and others added 2 commits October 9, 2023 10:09
Co-authored-by: Azanul Haque <42029519+Azanul@users.noreply.github.com>
Signed-off-by: shubhindia <shubhindia123@gmail.com>
@mlabouardy mlabouardy merged commit 9c54d99 into tailwarden:develop Oct 9, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants