Enzyme.jl icon indicating copy to clipboard operation
Enzyme.jl copied to clipboard

Add Julia formatter

Open simsurace opened this issue 1 year ago • 1 comments

Maybe this will help a bit with readability.

simsurace avatar Mar 05 '24 07:03 simsurace

Codecov Report

Attention: Patch coverage is 71.51319% with 529 lines in your changes are missing coverage. Please review.

Project coverage is 74.51%. Comparing base (573ab89) to head (a4c62f3).

:exclamation: Current head a4c62f3 differs from pull request most recent head 3cc48bd. Consider uploading reports for the commit 3cc48bd to get more accurate results

Files Patch % Lines
src/rules/llvmrules.jl 48.29% 76 Missing :warning:
src/internal_rules.jl 12.34% 71 Missing :warning:
src/compiler/optimize.jl 80.13% 60 Missing :warning:
src/rules/typeunstablerules.jl 38.04% 57 Missing :warning:
src/utils.jl 49.38% 41 Missing :warning:
src/api.jl 80.00% 36 Missing :warning:
src/compiler/utils.jl 75.47% 26 Missing :warning:
src/rules/jitrules.jl 81.88% 25 Missing :warning:
src/compiler/validation.jl 79.83% 24 Missing :warning:
src/rules/customrules.jl 81.44% 18 Missing :warning:
... and 13 more

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1326       +/-   ##
===========================================
- Coverage   93.54%   74.51%   -19.04%     
===========================================
  Files           7       35       +28     
  Lines         248    10811    +10563     
===========================================
+ Hits          232     8056     +7824     
- Misses         16     2755     +2739     

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

codecov-commenter avatar Mar 05 '24 08:03 codecov-commenter

There is an issue with permissions, probably requires admin permissions to fix.

simsurace avatar Mar 15 '24 23:03 simsurace

Can we merge the Formatter on its own and slowly apply the suggested changes? Right now this will cause large conflicts with other PRs. I think clang-format can do this and for Python there is https://dev.to/akaihola/improving-python-code-incrementally-3f7a

x-ref: https://github.com/domluna/JuliaFormatter.jl/issues/191

vchuravy avatar Mar 17 '24 21:03 vchuravy

Sure thing.

simsurace avatar Mar 18 '24 07:03 simsurace

Thanks! Lets see how this does and if it is to annoying we may disable it.

vchuravy avatar Mar 18 '24 15:03 vchuravy

How is it gonna work to get the codebase formatted now?

simsurace avatar Mar 19 '24 17:03 simsurace

As an example see https://github.com/EnzymeAD/Enzyme.jl/pull/1302 where the changes themselves will be formatted. So slowly over time the code base will match the format rules, but without the cost of having large merge conflicts with existing PRs

vchuravy avatar Mar 19 '24 21:03 vchuravy

Ok. Might take a very long time to traverse the entire code base, but we could still format the other files separately. But e.g. in #1307 the action still fails due to permissions.

simsurace avatar Mar 20 '24 16:03 simsurace