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

Update tools and fix CI #110

Merged
merged 5 commits into from
Oct 2, 2024
Merged

Update tools and fix CI #110

merged 5 commits into from
Oct 2, 2024

Conversation

swiatekm
Copy link
Contributor

@swiatekm swiatekm commented Sep 30, 2024

Update github.com/elastic/elastic-agent-libs so we get a more recent version of golangci-lint locally. Now running mage lint gives the same result as the Github Action.

Fix linter errors in existing code, drop deprecated linters, and revert the nakedret linter to its default config.

I've also updated the default Go version to 1.22.7, as the updated tooling requires it.

@swiatekm swiatekm requested a review from a team as a code owner September 30, 2024 17:03
@swiatekm swiatekm force-pushed the fix/ci branch 2 times, most recently from 24f7ff7 to 4753d60 Compare September 30, 2024 18:27
@ycombinator ycombinator added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Sep 30, 2024
Comment on lines -92 to -94
nakedret:
# make an issue if func has more lines of code than this setting and it has naked returns; default is 30
max-func-lines: 0

Choose a reason for hiding this comment

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

nakedret is a linting check in both the elastic-agent and beats repos. To keep coding standards consistent across repos, perhaps it should be kept here as well and added to the enabled checks?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To be clear, it is still enabled here. What this section does is set it to error for any function with a naked return. Removing it keeps it enabled, but at default configuration, which only applies to functions longer than 30 lines.

And yeah, imo we should do this everywhere. We recently did in elastic agent (elastic/elastic-agent#5442).

kubernetes/watcher.go Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

@swiatekm swiatekm merged commit 3f3a65d into main Oct 2, 2024
3 checks passed
@swiatekm swiatekm deleted the fix/ci branch October 2, 2024 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants