-
Notifications
You must be signed in to change notification settings - Fork 20
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
feat(lint): add pre-commit linting setup #573
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we please have markdownlint
added to the CI pipeline?
also, please rename it to |
683173c
to
59d894a
Compare
59d894a
to
1efde3f
Compare
1efde3f
to
ab77d2f
Compare
0cf0a5b
to
24a7566
Compare
CI run reported that the `deadcode` and `varcheck` linters are deprecated and replaced with `unused` which we are already using.
24a7566
to
03dead3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -1,4 +1,6 @@ | |||
--- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this isn't how YAML should start
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact it is, see section 2.2 of the YAML specification: https://yaml.org/spec/1.2.2/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's only mandatory to have them if you use directives in the YAML document. Directives are optional for usage, please see section 3.2.3.4 of the YAML specification. Please see examples in section 6.8.1 to have a better understanding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed its not mandatory and we can choose to leave it out. But stating "this isn't how YAML should start" isn't constructive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can choose to leave it out
If we choose not to, then we also need to add directives. I think leaving it out is the best option, WDYT?
I don't mink trunk vs pre-commit. It looks like trunk doesn't support autofixable yaml linter which might be annoying. Trunk i a for-profit company whereas pre-commit is more open. It also looks like trunk is missing some of the nice trailing whitespace, end-of-file, and shebang checks that come with pre-commit, didn't find any reference to something like that in their docs.Pre-commit also seems to be more widely used within Aiven. I can create an alternate version of this PR that utilizes trunk. |
there's a YAML linter and it's autofixable, you can see it in the example that I linked to you, it's called
it's free for Open Source usage :) trailing whitespace checks are included in
in our Go projects it's not really used, and the only such solution that we ever used is Trunk
sounds good; you can as well adjust this PR if you feel like it |
Yep, makes sense. Alternate Trunk based approach can be found here: #578. |
Closed in favor of #578 |
Best reviewed commit by commit.
Most of the diff is autofixed.