Skip to content

chore(lint): enable errname#301

Merged
gilescope merged 4 commits intomainfrom
chore-lint-errname
Feb 5, 2026
Merged

chore(lint): enable errname#301
gilescope merged 4 commits intomainfrom
chore-lint-errname

Conversation

@janishorsts
Copy link
Copy Markdown
Collaborator

No description provided.

@janishorsts janishorsts self-assigned this Jan 29, 2026
@janishorsts janishorsts requested a review from a team as a code owner January 29, 2026 16:17
@janishorsts janishorsts requested review from kmannislands and removed request for a team January 29, 2026 16:17
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 29, 2026

➖ Are we earthbuild yet?

No change in "earthly" occurrences

📈 Overall Progress

Branch Total Count
main 5659
This PR 5659
Difference +0

Keep up the great work migrating from Earthly to Earthbuild! 🚀

💡 Tips for finding more occurrences

Run locally to see detailed breakdown:

./.github/scripts/count-earthly.sh

Note that the goal is not to reach 0.
There is anticipated to be at least some occurences of earthly in the source code due to backwards compatibility with config files and language constructs.

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @janishorsts, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on refactoring error naming conventions across the codebase to comply with the errname linter's guidelines. It involves renaming specific error types and variables to follow the Error suffix for types and err prefix for variables. Additionally, documentation comments have been added to Error() methods for better clarity. While the pull request title indicates an intent to "enable errname", the linter's configuration in .golangci.yaml shows it being removed, suggesting either a temporary disablement during the fix process or a discrepancy between the title's intent and the configuration change.

Highlights

  • Error Naming Convention Refactoring: Renamed error types (e.g., "ErrEarthfileNotExist" to "EarthfileNotExistError") and error variables (e.g., "earthlyDirCreateErr" to "errEarthlyDirCreate") to align with Go's errname linter rules.
  • Error Interface Documentation: Added // Error implements [error] interface. comments to Error() methods in several custom error types for improved clarity and documentation.
  • Linter Configuration Adjustment: The errname linter has been removed from the .golangci.yaml configuration. This action contradicts the pull request title "enable errname", but the code changes themselves address violations that the errname linter would identify, suggesting a preparation phase for its eventual re-enablement.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request enables the errname linter and applies the necessary fixes across the codebase. The changes correctly rename error types to end with Error and error variables to start with err. The updated comments on Error() methods are also a good improvement for code clarity. I've found one minor issue related to an error type check that I've commented on. Overall, this is a good cleanup PR.

@janishorsts janishorsts requested a review from gilescope February 4, 2026 20:40
@gilescope gilescope enabled auto-merge (squash) February 5, 2026 06:17
@janishorsts
Copy link
Copy Markdown
Collaborator Author

/gemini review

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request enables the errname linter and applies the necessary fixes. The changes are excellent, improving code quality and adhering to Go conventions. Key improvements include renaming error types and variables to follow standard Go naming practices. The switch to errors.As for checking specific error types in cmd/earthly/subcmd/ls_cmds.go is a significant improvement in robustness and also fixes a latent bug in the error handling logic. Additionally, adding comments to clarify that Error() methods implement the error interface is a nice touch for documentation. Overall, this is a solid contribution that enhances code consistency and correctness.

@gilescope gilescope merged commit efe941d into main Feb 5, 2026
88 checks passed
@gilescope gilescope deleted the chore-lint-errname branch February 5, 2026 09:19
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.

2 participants