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

[Code Health] Standardize & enforce golang import linting #270

Closed
4 tasks
Olshansk opened this issue Dec 13, 2023 · 3 comments · Fixed by #684 or #674
Closed
4 tasks

[Code Health] Standardize & enforce golang import linting #270

Olshansk opened this issue Dec 13, 2023 · 3 comments · Fixed by #684 or #674
Assignees
Labels
code health Cleans up some code documentation Improvements or additions to documentation

Comments

@Olshansk
Copy link
Member

Objective

Standardize & enforce imports across the codebase

Origin Document

This is the result of several discussions from #253:

Screenshot 2023-12-13 at 12 59 38 PM
Screenshot 2023-12-13 at 12 59 20 PM

Goals

  • Standardize & enforce imports across the codebase
  • Enforce the same import rules across local development & CI for all users
  • Make it easy/trivial for any developer to adopt the same import linting rules & practices

Deliverables

  • Select the type golang import rules / tool / server we'll be using (e.g. gofmt, goimport, etc...)
  • Update the CI to block/enforce the selected styling
  • Update make go_imports to use the select tool
  • Document (or link to) how developers can configure their development environments to enable the selected tool on their machines (e.g. JetBrains, neovim, vscode, etc...)

Non-goals / Non-deliverables

  • Document all possible IDE configurations (just the ones you're using)

Creator: @Olshansk
Co-Owners: @bryanchriswhite @h5law

@Olshansk Olshansk added documentation Improvements or additions to documentation code health Cleans up some code labels Dec 13, 2023
@Olshansk Olshansk added this to the Shannon Quality of Life milestone Dec 13, 2023
@Olshansk Olshansk added this to Shannon Dec 13, 2023
@Olshansk Olshansk moved this to 🔖 Ready in Shannon Dec 14, 2023
@h5law
Copy link
Contributor

h5law commented Dec 16, 2023

Tools that I use that seem to be what we are looking for:

https://pkg.go.dev/github.com/incu6us/goimports-reviser#section-readme

This sorts imports the way we want them to be

https://github.com/yoheimuta/protolint

For protobufs - imports and lints very nicely (considers import order too)

This was referenced Dec 17, 2023
@Olshansk
Copy link
Member Author

@h5law After we merge in #252, let's add a page / section called devtools so all contributors can have the same configs.

@bryanchriswhite
Copy link
Contributor

bryanchriswhite commented Dec 21, 2023

See #283 (comment)
image
(@Olshansk @h5law)

@bryanchriswhite bryanchriswhite changed the title [Code Health] Standardize & enforce golang impot linting [Code Health] Standardize & enforce golang import linting Jan 4, 2024
@bryanchriswhite bryanchriswhite linked a pull request Jan 4, 2024 that will close this issue
11 tasks
@Olshansk Olshansk moved this from 🔖 Ready to 🏗 In progress in Shannon Jan 19, 2024
@h5law h5law moved this from 🏗 In progress to 📋 Backlog in Shannon Mar 11, 2024
This was linked to pull requests Jul 15, 2024
@bryanchriswhite bryanchriswhite moved this from 📋 Backlog to 🏗 In progress in Shannon Jul 15, 2024
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Shannon Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code health Cleans up some code documentation Improvements or additions to documentation
Projects
Status: ✅ Done
4 participants