JuliaBesties / BestieTemplate.jl

Template for Julia Programming Language packages using the copier engine.
http://JuliaBesties.github.io/BestieTemplate.jl/
Mozilla Public License 2.0
43 stars 9 forks source link

Change the default indentation from 2 to 4 #407

Closed abelsiqueira closed 1 month ago

abelsiqueira commented 2 months ago

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

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (90b3862) to head (b417f6e). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #407 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 4 4 Lines 81 81 ========================================= Hits 81 81 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

abelsiqueira commented 2 months ago

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.

abelsiqueira commented 2 months ago

I wonder if the correct play to do this more robustly, is to run JuliaFormatter on the generated files

The pre-commit includes JuliaFormatter, so it is doing that now in the tests. Thanks for the review!