-
-
Notifications
You must be signed in to change notification settings - Fork 610
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
move the codebase to 4 spaces indentation #2298
Comments
We're definitely long due for a formatting pass over the whole codebase + some tooling to ensure consistency going forwards. I think where things got stuck last time this came up was on which style to use. To my knowledge most of the presets in JuliaFormatter have received changes/bugfixes which make them more appealing now than before too (e.g. less aggressive line splitting of parameter lists). |
In favor of this and adding JuliaFormatter in whichever style we all like the most. |
Hi. Do we also want to add some Git hook to enforce the formatting style after each commit (or something similar)? Or do we leave it to the users to run the Julia Formatter whenever they make some code changes? |
A pre-commit hook that either checks or auto reformats would be ideal, just not sure how to make the installation and setup process for that straightforward. We'd also want some form of defense in depth for edits which are made e.g. using the GH web editor. There we can probably borrow the formatting check actions config from another Julia package. |
@ToucheSir, more questions: are we fine adding Another option is to create a new folder (say Also, there's another alternative to a pre-commit hook: how about just adding a test in CI which checks whether the code has been formatted as per our style? Something similar to the config in |
JuliaFormatter shouldn't be in the deps. I think a separate environment for tooling would be required as you say, though I'm not sure it needs to start with a
We'd need both, ideally. Having just the hook would miss contributions made through the web UI. Based on what I've seen with other packages, having just the CI check has in the past frustrated contributors who don't aren't running the formatter locally at a repo level when they're forced to revise the PR just to fix those changes. |
Two spaces indentation has always been an anomaly in the landscape of julia packages.
Should we get rid of it?
The text was updated successfully, but these errors were encountered: