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

Automatic formatting to allow for easier maintaince of forks #289

Open
ZeroEcks opened this issue Oct 3, 2024 · 3 comments
Open

Automatic formatting to allow for easier maintaince of forks #289

ZeroEcks opened this issue Oct 3, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@ZeroEcks
Copy link

ZeroEcks commented Oct 3, 2024

The Problem
There are numerous oddities with the formatting such as hanging spaces at the end of lines (as seen in share/packages/general.sh for example), uneven #----- comments, weird spacing around if [...] ;then vs if [...]; then, etc. These will make it hard for me to maintain a consistent fork as I would be making trivial changes to files, and would require me to further separate from upstream, where I would prefer not to.

The Solution

I think it would be best if this project adopted a specific bash formatter and style, so that it's easier to maintain a consistent style on my fork.

I might even have time to run a formatter over the code and provide a script that could be used in git hooks / ci / whatever if you want? I am mostly opening this issue as a vibe check as to if that is even wanted as a PR?

Alternatives
I can just maintain a fork anyway, it's really not that big of a deal really, I was mostly wanting to vibe check if this would be a welcome contribution?

There is also the possibility there is a style that is being followed, and if it could be clarified, that would help with configuring my editor.

@ZeroEcks ZeroEcks added the enhancement New feature or request label Oct 3, 2024
@mylinuxforwork
Copy link
Owner

@ZeroEcks This is a very interesting comment. You're talking about bash formatter. Are there add ons available or would you suggest to create a dedicated script to run over the files and highlight consistence issues?

@mylinuxforwork mylinuxforwork added the to be confirmed Issue is currently under review and has not been released label Oct 4, 2024
@ZeroEcks
Copy link
Author

ZeroEcks commented Oct 4, 2024

I'd probably recommend just running shfmt over it and maybe shellcheck (if you want) to pick up on some style / safety issues with the code. These both have autofixing capabilities, so submitting a PR + writing a helper script to run them as a hook / CI wouldn't be much effort for me. It mostly depends if that's something you want :)

I can recommend shellcheck at least though, it encourages a style of writing bash that avoids bugs.

@mylinuxforwork mylinuxforwork removed the to be confirmed Issue is currently under review and has not been released label Oct 5, 2024
@mylinuxforwork mylinuxforwork added this to the v2.9.8 milestone Oct 5, 2024
@mylinuxforwork
Copy link
Owner

#293

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants