Skip to content

Add Runic.jl formatter support#30

Open
shravanngoswamii wants to merge 9 commits intomainfrom
sg-Runic
Open

Add Runic.jl formatter support#30
shravanngoswamii wants to merge 9 commits intomainfrom
sg-Runic

Conversation

@shravanngoswamii
Copy link
Copy Markdown
Member

@shravanngoswamii shravanngoswamii commented Apr 21, 2026

Adds a formatter input (juliaformatter | runic) so repos can opt into Runic. JuliaFormatter remains the default.

Closes #23

@shravanngoswamii shravanngoswamii marked this pull request as ready for review April 21, 2026 11:32
Comment thread Format/action.yml Outdated
Comment on lines +87 to +92
import Runic
julia_files = readlines(`git ls-files -- "*.jl"`)
if isempty(julia_files)
println("Runic: no .jl files tracked, skipping.")
else
Runic.main(append!(["--inplace"], julia_files))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can use Runic.main(["--inplace", "."]) as well, right? Is there a reason to discard the paths and use git ls-files?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

runic-action use git ls-files internally so I used same here and too avoid touching git ignored files too.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. But AFAICT, it should be fine to format gitignored files because the success/failure check later on uses git diff. I didn't check the source code, but I also expect that the reviewdog action should only comment on files that git tracks (after all there's no way it can add a review comment to a file that's not even in the repo).

I'm not really all that fussed about it, I just think it'd be more consistent to use the same arguments and do the same things with both formatters.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somewhat agree, I have updated code, does it look fine now?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

allow customisation of formatter

2 participants