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

Add gosimports linter #647

Merged
merged 3 commits into from
Mar 3, 2022
Merged

Add gosimports linter #647

merged 3 commits into from
Mar 3, 2022

Conversation

wagoodman
Copy link
Contributor

@wagoodman wagoodman commented Feb 26, 2022

Today we use the goimports linter to check and fix imports preferences, however, there is a downside that IDEs tend to add extra whitespace when automatically adding import statements, a case that goimports ignores (see golang/go#20818). This PR replaces goimports with gosimports which is 1:1 the same tool with the exception for this specific case.

Additionally this PR incorporates @kzantow s suggestion to additionally group anchore imports last 🙌 .

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
@wagoodman wagoodman requested a review from a team February 26, 2022 23:40
@wagoodman wagoodman self-assigned this Feb 26, 2022
@wagoodman wagoodman marked this pull request as ready for review March 1, 2022 19:55
Copy link
Contributor

@kzantow kzantow left a comment

Choose a reason for hiding this comment

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

Looks great! -local really does the trick IMO

@wagoodman wagoodman merged commit ad9918a into main Mar 3, 2022
@wagoodman wagoodman deleted the add-gosimports branch March 3, 2022 19:50
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