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
Enable automated source code formatting #3142
Comments
Personally I don't worry about coding syntax style differences. For example personally I don't care if
or
is used because both are reasonably easy Therefore
So as long as it is reasonably easy for me For example I prefer spaces as separators
because personally I find that easier to read
But this is really not something which makes In contrast for example I think that backticks |
@schlomo |
Stale issue message |
@jsmeix the problem we saw just now is actually only a problem of the transition: If all the source code would have been formatted by a tool then whenever somebody works on code the formatting tool ensures that there are no needles formatting changes. As we have not yet reformatted the ReaR code via tool we keep seeing this problem. Therefore indeed I propose to decide upon a tool and "convert" the source code with a single PR to that automated formatting. The main downside I can see to this is that we loose the easy The alternative is IMHO to give up on very consistent ReaR source code formatting and accept PRs that mostly look good without too much attention to the details. |
My personal preference is to give up on Cf. my above |
@jsmeix I can also live with accepting different coding styles and formattings, but then I'd expect it to be OK to change the formatting as part of working on code and not be enslaved to the "original" formatting |
@rear/contributors But if we "convert" our whole source code with a single PR
where automated indentation would change the string value. |
@schlomo I did this very often when I completely overhauled a script |
@rear/contributors |
Perhaps a good argument against a I would like to avoid unhelpful discussions about I think that coding style discussions could become I even think that coexisting different coding styles in ReaR Simply put: |
…der.sh to layout/save/default/445_guess_bootloader.sh (issue1266) and some other minor adaptions that are related to issue1266
See also #3138 (comment) for context.
I'd like to be able to use automated source code formatting with ReaR, and the go-to-tool for that seems to be shfmt which is also supported in our
.editorconfig
file and in various IDEs (I'm currently using Visual Studio Code with https://marketplace.visualstudio.com/items?itemName=foxundermoon.shell-format).Our https://github.com/rear/rear/wiki/Coding-Style has some rules that conflict with the abilities of this formatter, specifically adding extra white space or padding around code fragments or before
;
.I wasn't able to find a shell script formatting solution that works in the IDEs that allows such a coding style, and I believe that automated consistent formatting is more important. Therefore I'd like to suggest to adjust our coding style to also allow (or demand?) a more compact way of writing Bash and to recommend using a shell script formatter to format the code.
I'm happy to submit the PR with the change that reformats all lines, although that would kill
git blame
and therefore I'd rather prefer that we reformat files as we work on them.Personally I'd prefer to not require a "clean"
git blame
as a requirement over consistent and automated code formatting.What do you think @rear/contributors?
The text was updated successfully, but these errors were encountered: