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

Inconsistent code style #74

Open
lipkau opened this issue Sep 25, 2018 · 11 comments
Open

Inconsistent code style #74

lipkau opened this issue Sep 25, 2018 · 11 comments

Comments

@lipkau
Copy link
Contributor

lipkau commented Sep 25, 2018

The functions in this repo have many different styles of code.

This is not a big problem, but a contributor using an editor that "fixes" the style (eg: VSCode), will flag a lot more changes than required.

Is it in the interest of this module to harmonize the style to avoid this? And if so, with what rules? Shall this be enforced with tests?

@RamblingCookieMonster
Copy link
Owner

Agreed, consistency would be good. Will get back to you but might be a bit (other priorities on this and other projects, summit proposal pestering, wrapping up work before parental leave, etc.).

@pauby
Copy link

pauby commented Jan 1, 2019

If we could get agreement on a primary style, PRs would be easier to submit?

@lipkau
Copy link
Contributor Author

lipkau commented Jan 1, 2019

Not really. Primary advantages are:

  • help devs to format code by storing .vscode\settings.json in the repo
  • enable enforcing of common styling
  • easier to review changes to code, as styling is kept consistent
    • if you use vscode now and use the code formatting setting, you will re-format a lot of code without making any real changes to it

@pauby
Copy link

pauby commented Jan 1, 2019

Not really

  • enable enforcing of common styling

... Which makes submitting PRs easier (saves the submitter having to guess which style to pick) 👍

.vscode\settings.json in the repo

Or use .editorconfig so we're not tying people to an IDE. Or use both (as they are unlikely to change much).

@lipkau
Copy link
Contributor Author

lipkau commented Jan 1, 2019

Or use .editorconfig so we're not tying people to an IDE. Or use both (as they are unlikely to change much).

This helps with other stuff... EOL char, file encoding, indention, etc...
but code formatting requires more than that. to be more precise:
This setting for the powershell extension in vscode
https://github.com/AtlassianPS/ConfluencePS/blob/b176b2382c2551af56eec460f71140d79020ceb6/.vscode/settings.json#L12

@pauby
Copy link

pauby commented Jan 1, 2019

This helps with other stuff... EOL char, file encoding, indention, etc...

It does. It's limited. But using it stops you mandating people use VS Code (as believe it or not, not everybody does) and raising the bar for people becoming involved. For those people it's the only thing you can give them. That's why I suggested using both:

Or use both (as they are unlikely to change much).

@lipkau
Copy link
Contributor Author

lipkau commented Jan 1, 2019

That's why I suggested using both

that's what I do in my modules :-)

@lipkau
Copy link
Contributor Author

lipkau commented Jan 2, 2019

I would recommend Stroustrup

references:
https://en.wikipedia.org/wiki/Indentation_style#Styles
PoshCode/PowerShellPracticeAndStyle#81 (comment)

@lipkau
Copy link
Contributor Author

lipkau commented Jan 2, 2019

If this can be defined, I can submit a PR by the next day :-)

@lipkau
Copy link
Contributor Author

lipkau commented Apr 26, 2019

Any news on this?

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

No branches or pull requests

3 participants