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

Reformatted the code #1572

Merged
merged 14 commits into from
Aug 12, 2022
Merged

Reformatted the code #1572

merged 14 commits into from
Aug 12, 2022

Conversation

giulio-coa
Copy link
Contributor

I did some style improvements

@orazioedoardo
Copy link
Member

Thanks but I think we should convert the entire script to a code style we agree on and then start requiring it, instead of spot pull requests. I'm about to start a discussion now.

@giulio-coa giulio-coa force-pushed the formatting_enhancements branch 2 times, most recently from 3f2c667 to 0c56cbc Compare July 21, 2022 16:45
Copy link
Member

@orazioedoardo orazioedoardo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering discussion #1573 and my previous comment, I wouldn't merge this pull request.

@giulio-coa
Copy link
Contributor Author

If we can determine the code style rules, this PR can become the one that will reformat the code

@orazioedoardo
Copy link
Member

I think it's better to wait for #1567 and then reformat the code on top of that, unless you want to force push all the time to handle conflicts.

@giulio-coa giulio-coa force-pushed the formatting_enhancements branch 14 times, most recently from 8b6a02a to a732d11 Compare July 27, 2022 07:41
@giulio-coa
Copy link
Contributor Author

giulio-coa commented Jul 27, 2022

As mentioned in discussion #1573, I have reformatted the code according to the Google rules
Only file auto_install/install.sh is missing because I'm waiting for the merge of #1576

@giulio-coa giulio-coa force-pushed the formatting_enhancements branch 5 times, most recently from 63f864a to de3cede Compare July 27, 2022 12:53
Fix a code style bug into the style stage
Fix a code style error into the shfmt command
Fix a code style bug
Add the scripts into the ciscripts/ directory to the lint and the style stages
Fix a code style bug
Copy link
Member

@coolapso coolapso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Improve the code style of some pieces of code
@orazioedoardo
Copy link
Member

The 80 character limited suggested in the Google style guide is actually too restrictive IMHO, makes too many statements, variable definitions, commands more difficult to read, and probably slower too in cases like this when you need to call the command many times.

@coolapso
Copy link
Member

coolapso commented Aug 9, 2022

The 80 character limited suggested in the Google style guide is actually too restrictive IMHO, makes too many statements, variable definitions, commands more difficult to read, and probably slower too in cases like this when you need to call the command many times.

Kinda agree, however having too big lines its also not that good. Guess we can agree in being flexible with that rule, and apply the 80 Chars rule whenever possible but open some exceptions where it actually doesn't help much.

@giulio-coa
Copy link
Contributor Author

Kinda agree, however having too big lines its also not that good. Guess we can agree in being flexible with that rule, and apply the 80 Chars rule whenever possible but open some exceptions where it actually doesn't help much.

For sure, one exception will be " not apply the limit if it make the code less readable and/or harder to parse mentally"

@giulio-coa
Copy link
Contributor Author

@orazioedoardo could you approve and merge the request ?

@orazioedoardo
Copy link
Member

@giulio-coa I'm not sure I want to, as it is, considering this. To add, as I said before, this is much less readable than this.

auto_install/install.sh Outdated Show resolved Hide resolved
@coolapso
Copy link
Member

coolapso commented Aug 11, 2022

Ok then, let's try to not get lost here and not let this drag for too long.

We should apply the 80 Line rule whenever it is possible, however let's not get too strict about it and be flexible when to use it or not.

Let's get this merged when changes are applied, and later on if we feel that we should fix / review some lines, it can come on separate PR.

Revert the code style of a piece of code
@coolapso coolapso merged commit f59c693 into pivpn:test Aug 12, 2022
@giulio-coa giulio-coa deleted the formatting_enhancements branch August 12, 2022 22:31
@coolapso
Copy link
Member

🎉 This PR is included in version 4.1.0-test.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@coolapso
Copy link
Member

🎉 This PR is included in version 4.1.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants