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

Feature: enable auto fixable linters #132

Merged
merged 12 commits into from
Jul 10, 2024
Merged

Conversation

dsonck92
Copy link
Collaborator

@dsonck92 dsonck92 commented Jul 9, 2024

This MR will enable linters and apply their suggested changes. Any linters that need manual decisions are for now excluded.

@loboda4450
Copy link
Collaborator

Hello @dsonck92,

honestly I do not think that including linting within the same pipelines is a good idea. Imo it should be splitted into separate CIs.

@dsonck92
Copy link
Collaborator Author

dsonck92 commented Jul 9, 2024

@loboda4450 I don't quite follow. Each module has a separate pipeline. Or do you mean you want to have the linting only on MRs and excluding them on others? I'm currently not entirely up to date with the naming in Github actions as I'm using Gitlab CI myself.

But feel free to tweak the CIs in a way you think works best. I'm curious about your proposal

@loboda4450
Copy link
Collaborator

I allowed myself to change them on your branch, so as not to build on each PR :D

@dsonck92
Copy link
Collaborator Author

dsonck92 commented Jul 9, 2024

I will cherry-pick that to the fix-module-names PR as I want to correct the module names first. This makes this PR more reliable as well (there seems to be fighting linters on how to sort the imports) I hope

@dsonck92 dsonck92 force-pushed the feat/enable-auto-fixable-linters branch from 3a3a694 to dded8ea Compare July 9, 2024 19:12
@dsonck92
Copy link
Collaborator Author

dsonck92 commented Jul 9, 2024

@loboda4450 I realized that the old pipelines were still in the build-* files, I think this was not intended?

@dsonck92 dsonck92 force-pushed the feat/enable-auto-fixable-linters branch from 5f55292 to 79dabac Compare July 9, 2024 19:37
@loboda4450
Copy link
Collaborator

@dsonck92 obviously, I was in a rush and forgot to remove them :)

@dsonck92
Copy link
Collaborator Author

dsonck92 commented Jul 9, 2024

@bouassaba the godot linter is an autofix capable linter, but it's complaining about your style of comments as they don't follow go standards. I will delay this as it's a larger change (applying documentation to everything public). Also as note to self.

@bouassaba
Copy link
Member

@bouassaba the godot linter is an autofix capable linter, but it's complaining about your style of comments as they don't follow go standards. I will delay this as it's a larger change (applying documentation to everything public). Also as note to self.

Is it complaining about the Swag comments used to generate OpenAPI specs?

@dsonck92
Copy link
Collaborator Author

dsonck92 commented Jul 9, 2024

Ahhhhh, that's where they are coming from. Yeah, I think it would have been nice if that project used the go: prefix convention here.

Well, in particular it just wants a dot at the end of a comment sentence

@bouassaba
Copy link
Member

Ahhhhh, that's where they are coming from. Yeah, I think it would have been nice if that project used the go: prefix convention here.

Well, in particular it just wants a dot at the end of a comment sentence

What if we try to add the dot and do the adjustments required by the linter, then see if the Swag generation is still working? For generating the OpenAPI with redocly, I have it documented on the README.md of each service that has it.

@dsonck92
Copy link
Collaborator Author

dsonck92 commented Jul 9, 2024

A convention I used in the past was to add a trailing dot at the end of the comment, which should prevent the dot from interfering with any of the instruction lines

@dsonck92 dsonck92 force-pushed the feat/enable-auto-fixable-linters branch from 805def7 to 26f2ab4 Compare July 9, 2024 20:43
@dsonck92 dsonck92 marked this pull request as ready for review July 9, 2024 20:44
@dsonck92
Copy link
Collaborator Author

dsonck92 commented Jul 9, 2024

I think these are all the automatic linters. The rest need some consideration, and especially wsl will completely go crazy on the formatting as it doesn't like all the compressed code. I do think, based on the code at work, that adopting it makes for pretty readable code. But sometimes it's a bit tricky to understand and definitely opinionated.

@dsonck92 dsonck92 requested a review from bouassaba July 9, 2024 20:47
@bouassaba
Copy link
Member

I'm all in for code readability - totally agree 👍 I will be happy to follow the recommendations suggested by the tools.

@bouassaba
Copy link
Member

I had a look through the diff, the automatic linters are doing a pretty good job.

@bouassaba
Copy link
Member

@dsonck92 I'm done with the new Go based webdav, can we also add the linters for it?

@dsonck92 dsonck92 force-pushed the feat/enable-auto-fixable-linters branch from 26f2ab4 to bc0fb98 Compare July 9, 2024 22:25
@dsonck92
Copy link
Collaborator Author

dsonck92 commented Jul 9, 2024

@bouassaba I think this includes everything now. There are some interesting linters we should enable for webdav though.

@dsonck92 dsonck92 force-pushed the feat/enable-auto-fixable-linters branch from bc0fb98 to b57badd Compare July 9, 2024 22:27
@dsonck92 dsonck92 requested a review from bouassaba July 9, 2024 22:27
@dsonck92 dsonck92 force-pushed the feat/enable-auto-fixable-linters branch from b57badd to f80b1ef Compare July 9, 2024 22:41
@dsonck92 dsonck92 force-pushed the feat/enable-auto-fixable-linters branch from f80b1ef to 6c4ffcf Compare July 9, 2024 23:59
@dsonck92 dsonck92 merged commit f2ec471 into main Jul 10, 2024
10 checks passed
@loboda4450 loboda4450 deleted the feat/enable-auto-fixable-linters branch July 18, 2024 17:11
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