Skip to content
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

Feature request: package tests with feedback #871

Open
adrhill opened this issue Sep 18, 2024 · 3 comments
Open

Feature request: package tests with feedback #871

adrhill opened this issue Sep 18, 2024 · 3 comments

Comments

@adrhill
Copy link

adrhill commented Sep 18, 2024

I like to use @test JuliaFormatter.format(MyPackage; verbose=false, overwrite=false) in the tests of packages I develop. It ensures only formatted code gets merged via CI.

However, I've recently gotten feedback that this "creates a barrier to contributions"1 and that contributors have "no clue what was causing it or how to fix it"2.

It would be nice to have a testing utility that prints beginner-friendly usage instructions for JuliaFormatter and/or a diff when the test fails.

CC @greimel @eford

Footnotes

  1. https://github.com/JuliaPluto/PlutoTeachingTools.jl/pull/48#discussion_r1764812942

  2. https://github.com/JuliaPluto/PlutoTeachingTools.jl/pull/53#issuecomment-2358493189

@domluna
Copy link
Owner

domluna commented Oct 6, 2024

I think in the rewrite to JuliaSyntax friendlier messages will be possible, since it locates the exact part of the file that's problematic.

@adrhill
Copy link
Author

adrhill commented Oct 7, 2024

Would you be open to a PR which adds a JuliaFormatter.test_formatting() function that is a thin wrapper around format with additional usage instructions in case of a failure?

@domluna
Copy link
Owner

domluna commented Oct 7, 2024 via email

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

No branches or pull requests

2 participants