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

check whitespace as part of CI? #462

Closed
simeonschaub opened this issue Sep 21, 2021 · 7 comments · Fixed by #482
Closed

check whitespace as part of CI? #462

simeonschaub opened this issue Sep 21, 2021 · 7 comments · Fixed by #482

Comments

@simeonschaub
Copy link
Member

I think we should have a job that checks for trailing whitespace and newlines at the end of files. It's not a huge deal, but I encounter that quite often in our code base and it can make diffs a bit more confusing to read since some editors correct this automatically.
Might also make sense to check for correct unicode normalization as well, I think we had some problems with that in the past.

@mcabbott
Copy link
Member

For spaces at least, one other possibility would be to check in a .editorconfig file, which most people's editors will obey.

@oxinabox
Copy link
Member

Might also make sense to check for correct unicode normalization as well, I think we had some problems with that in the past.

Yeah, it is something like julia compilation gives one form,
but sometimes copy-pasting through different editors gives a different form

@oxinabox
Copy link
Member

We might just want to apply the total formatting solution that makes code-suggestions to follow BlueStyle.
I suspect JuliaFormatter will also handle whitespace and newlines at end of file.

@simeonschaub
Copy link
Member Author

simeonschaub commented Sep 21, 2021

For spaces at least, one other possibility would be to check in a .editorconfig file, which most people's editors will obey.

I would probably just do both, making assumptions about people's setups is always dangerous... 😄

@st--
Copy link
Contributor

st-- commented Sep 23, 2021

We might just want to apply the total formatting solution that makes code-suggestions to follow BlueStyle.
I suspect JuliaFormatter will also handle whitespace and newlines at end of file.

Strongly support this. I can confirm that JuliaFormatter does handle whitespace & newlines, and overall including an automatic code formatter makes life SO much easier when dealing with pull requests. Saves a lot of mental effort on both writer & reviewer side that can be put to more effective use:)

You can also add a Github Action that automatically suggests the required formatting changes, see e.g. https://github.com/JuliaGaussianProcesses/AbstractGPs.jl/blob/master/.github/workflows/format.yml

@simeonschaub
Copy link
Member Author

@st-- Do you want to make a PR?

@st--
Copy link
Contributor

st-- commented Oct 7, 2021

@simeonschaub #482

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

Successfully merging a pull request may close this issue.

4 participants