-
Notifications
You must be signed in to change notification settings - Fork 118
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 shellcheck and fix complaints #412
Conversation
/test-ubuntu-integration-main |
88aeed5
to
574a2a5
Compare
/test-ubuntu-integration-main |
/test-centos-integration-main-ironic-source |
/approve |
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.
I absolutely like the markdown verification, but the diff in the scripts seems mostly useless. There is no point to enforce ${variables} over $variables except that in a few cases.
Landing this will also turn our life downstream into a nightmare, because no backports will apply cleanly (if you do backporting, you'll have the same problem too).
I'm just trying to be consistent here. Currently the scripts are completely mixed use. It makes it much more readable as well, making it immediately clear that you're dealing with a variable. Quoting: https://google.github.io/styleguide/shellguide.html for example on variable expansion:
I have no visibiility into your internal development practices, and in this repo there are no branches. I'm trying to have all repositories under metal3-io to have consistent coding style, basic quality checks in place etc so they are in the long run easier to maintain, developers have safety nets in place and faster feedback cycle. If you feel this change is not worth of merging or causes too much trouble for you, then it is your right to decline it, but I'd hope the opposite, that you possibly take this into your backports, and after that there is no more conflicts. But like I said, I got no idea what your setup looks like and if that is feasible. |
The Google style guide is pretty opinionated and may not reflect how most people write scripts. Nor does it reflect the intention of $ vs ${}, which is: ${} is used when the variable name is followed by characters that are valid in a variable name, e.g. UPD: note that you're violating their first rule:
|
There is no consistency like I said already, so nothing to stick by. |
/hold Holding this so it doesn't get merged by drive-by lgtm. @elfosardo and @dtantsur please settle if you are willing to take this in. I'm happy to make adjustments if required, but as stated before, I'm going for consistency, maintainability and readability, preferably organization wide. If this does not work for you, I can drop this, and you can implement it in a way that works for you. |
574a2a5
to
343b266
Compare
/test-ubuntu-integration-main |
343b266
to
49bde75
Compare
/test-ubuntu-integration-main |
@dtantsur @elfosardo Its been a week. Have you guys discussed this? |
It's now been two weeks. Can you guys discuss your mutual stance on this? The question in the end is rather simple: Do you want to take the PR in or not? We have bunch of shell code that is a bit messy, not linted, not consistent. We have here PR cleaning it up for you, maybe a bit opinionated PR but guess what, most of the languages/ecossytems have rather opinionated best practices/style guides these days (gofmt, prettier, k8s and so on), because its effective. They're easy for anyone to work in, you can automate your editors and your CI.
This still stands as well. |
49bde75
to
a9be9f0
Compare
Separated markdownlint to #413 and not held back by shellcheck discussion. |
/test-ubuntu-integration-main |
/test-centos-integration-main-ironic-source |
a9be9f0
to
57ae5fc
Compare
Took away all curly brace changes etc. @dtantsur PTAL. /test-ubuntu-integration-main |
/test-centos-integration-main-ironic-source |
57ae5fc
to
2b0e293
Compare
/test-centos-integration-main-ironic-source |
2b0e293
to
d4ec6b5
Compare
/test-centos-integration-main-ironic-source |
Much better, thanks! I'm not a fan of some changes, but I understand the consistency argument here. Just one question inline. |
d4ec6b5
to
305dec4
Compare
Add shellcheck. Fix all the shellcheck complaints. Another PR in project-infra will activate the check for PRs.
305dec4
to
02a56a9
Compare
I took some more unnecessary changes off, and I think I addressed all comments. /test-centos-integration-main-ironic-source |
/unhold |
Cleura is busted but one more try for today. /test-centos-integration-main-ironic-source |
/cc @dtantsur Good for LGTM now? |
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.
/lgtm
@dtantsur can you PTAL and remove changes requested so we can merge this? All comments should be addressed now. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dtantsur, elfosardo The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
METAL-726: Update packages for OCP 4.15 and pin ironic versions
Add shellcheck. Fix all the shellcheck complaints, and make shell code consistent Bash.
Another PR in project-infra will activate the check for PRs.
Markdownlint is separated to its own PR #413