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

spacemit: shellfmt again after quoting fixes #7529

Conversation

rpardini
Copy link
Member

spacemit: shellfmt again after quoting fixes

  • spacemit: revert shellfmt that messed up
    • revert spacemit.conf changes from 2f63a9c
  • spacemit: apply quoting to fix more glaring problems
    • add a TODO for the original author of a "if $(...)" statement which I can't understand; it's still wrong
  • spacemit: shellfmt again after quoting fixes
    • problematic if $(...) remains; just indent changed

- revert spacemit.conf changes from 2f63a9c
- add a TODO for the original author of a "if $(...)" statement which I can't understand; it's still wrong
- problematic `if $(...)` remains; just indent changed
@github-actions github-actions bot added size/small PR with less then 50 lines Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... labels Nov 30, 2024
@rpardini
Copy link
Member Author

@The-going identified the mess introduced by shellfmt. I've reverted the shellfmt, fixed a few quoting issues, and re-ran it. Thanks @The-going for finding and reporting it

@rpardini rpardini marked this pull request as ready for review November 30, 2024 08:18
@The-going
Copy link
Contributor

spacemit: shellfmt again after quoting fixes

shellfmt script\program is most likely an assistant for a person who can find typos and suggest something,
but he is very often mistaken.
I interpret everything that shellfmt writes\prompts like this:
"Hey, man, I think there's something wrong with this place. Pay attention to this."
But no more.

I'll check the changes in more detail tomorrow.

@The-going
Copy link
Contributor

I understand your desire to make the script better.
But! But this is a system file!
And if we make any changes, we are obliged to test these changes on various
possible operating systems.

I do not know for sure in which environment this file will be executed.
With which environment variables and how a completely specific
operating system shell will handle the disclosure of double surrounding quotes.
This file was written by two people and checked each other after making changes.
Personally, I tested it in debian and openSUSE.

@The-going
Copy link
Contributor

@rpardini
What are we going to do about it?

  1. Exclude the system file from the purposes of shelfmt analysis.
  2. Fix it and spend a lot more time on tests in various shells.

@rpardini
Copy link
Member Author

rpardini commented Dec 4, 2024

Dunno. Leave it broken, then.

@rpardini rpardini closed this Dec 4, 2024
@The-going
Copy link
Contributor

Dunno. Leave it broken, then.

Did I misunderstand?

@rpardini
Copy link
Member Author

rpardini commented Dec 4, 2024

  1. I broke a file that was according to you carefully hand-crafted, by running shellfmt against it.
  2. you pointed out the breakage
  3. I sent a new PR (this one) un-doing my shellfmt, fixing the more glaring/blatant problems found in the original, and running it again.
  4. you claim that is not good enough and that shellfmt is not good enough and that changes should be tested in different shells (?) and different OS's (?). Despite my best efforts, I've no time for such, thus I closed this PR. A shame, really, since I broke something and wanted to fix it, but it seems it's impossible to reason.

Thus the closure, as I simply don't have the resources (time) to keep on discussing this. Terribly sorry.

@The-going
Copy link
Contributor

Terribly sorry.

No problem!
I'll do the cleaning.
At least tell me which version of shellfmt I need to use for testing in a production environment.

@rpardini
Copy link
Member Author

rpardini commented Dec 5, 2024

We've GHA workflows that auto-update shellfmt and shellcheck.
Please use
bash lib/tools/shellcheck.sh
and
bash lib/tools/shellfmt.sh
those use the exact versions and configurations that everyone is expected to use, and are also used by the CI jobs ran.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hardware Hardware related like kernel, U-Boot, ... Needs review Seeking for review size/small PR with less then 50 lines
Development

Successfully merging this pull request may close these issues.

2 participants