-
Notifications
You must be signed in to change notification settings - Fork 97
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 linting to Go backend #1226
Comments
I highly agree with this and something I mentioned in the past as part of the UI refactor. I think this is less of an issue for the go side where vscode can work pretty barebones and is more of a problem with the UI side since certain extensions are necessary to make it function.
This I am a bit more hesitant on due to how different setups might be using our repo (and no hard guarantee that someone is even using vscode). IE: with my current setup I have the repo inside a vscode workspace where it sits adjacent to other projects. Changing how we have to use the repo would require changes to my setup. For the folks that don't use vscode, which has been at least 3 contributors from what I have seen, we'd be also lessening their support. Not saying that it is necessarily bad to go that route, but personally I'd try as much as we can without it/only do it as a last resort due to the other side effects it can bring.
IMO I'd want to initial avoid pre-commit hooks. While they can be great when they are working properly, they can also get in the way when you are trying to do a quick fix/something not completely standard and only results in a headache. Because all code is required to go through a PR before it hits mainline, I think making sure everything is done on github CI (with our ability to bypass/ignore if necessary) should be more than enough. If we change the gh actions before |
Both VS Code and pre-commit can be skipped if the person doesn't want to use them (start vs code on top level folder / supply -n/--no-verify to a commit on cli or select the no verify commit variant in your favorite git ui). I think it's ok to add these things, describe them as optional but recommended and show ways to bypass. |
To make code style consistent and avoid bad practices, we should introduce linting to our Go backend. I think it would be nice to run these
both as a pre-commit hook andin CI (GitHub Actions).VS Code related:
.vscode
folder with recommended extensions and settings.frontend
(gcsim.app),backend
(all Go backend related files) anddocs
(docs.gcsim.app). After that we can place.vscode
inside ofbackend
..vscode
to be picked up, people using VS Code should open thebackend
folder only. Opening VS Code in a subfolder/higher level folder would make it unable to pick up the.vscode
folder. This restriction should be communicated somewhere.some relevant links:
https://bongnv.com/blog/2021-08-29-pre-commit-hooks-golang-projects/The text was updated successfully, but these errors were encountered: