-
Notifications
You must be signed in to change notification settings - Fork 11
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
Change the default indentation from 2 to 4 #407
Conversation
763d244
to
4fb7b34
Compare
This is the default in the Julia ecosystem, both in the official guidelines and on various styles. The Julia files in the template have been changed to use 4 spaces. The other files in the template are still using 2 spaces. This should be changed to 4 when pre-commit is run for the first time. Update the consistency tests that verifies Copier's API to run the pre-commit before the comparison, to ensure that formatting changes don't influence the tests. Closes #403
4fb7b34
to
b417f6e
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #407 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 4
Lines 81 81
=========================================
Hits 81 81 ☔ View full report in Codecov by Sentry. |
This took longer than expected. The changes was simple, but the tests failed because the default formatting changed between commits. A simpler PR could be not change the template files' format, but the issue would eventually bite, so I've updated the tests to run pre-commit before comparing the resulting packages. One thing I am not too pleased about this is that now the normal tests also require installing pre-commit. @fdiblen, I've request your review. If you want to discuss at the office, I'll be there Thursday. @oxinabox, let me know if you want to review as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if the correct play to do this more robustly,
is to run JuliaFormatter on the generated files, with the given indent setting, (and possibly no others)
after running copier.
So it doesn't actually matter what was in the files being generated.
Anyway, this looks good to me.
The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went over all the changes and it looks good! Thank you, Abel!
This is the default in the Julia ecosystem, both in the official guidelines and on various styles.
The Julia files in the template have been changed to use 4 spaces.
The other files in the template are still using 2 spaces.
This should be changed to 4 when pre-commit is run for the first time.
Update the consistency tests that verifies Copier's API to run the
pre-commit before the comparison, to ensure that formatting changes
don't influence the tests.
Related issues
Closes #403
Checklist
I am following the contributing guidelines
Tests are passing
Lint workflow is passing
Docs were updated and workflow is passing
CHANGELOG.md was updated