Skip to content

Opting out of enforce_triplequote_docstring.#1204

Merged
penelopeysm merged 4 commits into
JuliaEditorSupport:masterfrom
iago-lito:enforce_triplequote_docstring
Jul 20, 2026
Merged

Opting out of enforce_triplequote_docstring.#1204
penelopeysm merged 4 commits into
JuliaEditorSupport:masterfrom
iago-lito:enforce_triplequote_docstring

Conversation

@iago-lito

@iago-lito iago-lito commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Here is a first shot at addressing #1203 it @penelopeysm.
I am happy with it yet except that I don't understand why this (new) test is failing..?
It seems that it is failing due to something outside the strict format_docstring() function, because this one does return the correct result IIUC.
Maybe that leading whitespace is preventing the docstring to be recognized as such?

@iago-lito
iago-lito force-pushed the enforce_triplequote_docstring branch from f87db42 to 9f843c3 Compare July 20, 2026 11:02
@iago-lito
iago-lito force-pushed the enforce_triplequote_docstring branch from 9f843c3 to 2480938 Compare July 20, 2026 11:03
Comment thread test/options.jl Outdated

@penelopeysm penelopeysm left a comment

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.

Thanks for looking into it!

Comment thread test/options.jl Outdated
Comment thread src/format_docstring.jl Outdated
Comment thread test/options.jl Outdated
Comment thread test/options.jl Outdated
Comment thread src/format_docstring.jl
Comment thread src/format_docstring.jl Outdated
@penelopeysm

Copy link
Copy Markdown
Member

Also, I'm sure you noticed this too but the argument needs to be added to the jlfmt CLI app at src/argparse.jl:

    option(
        "--enforce-triplequote-docstring";
        ...
    ),

@iago-lito

Copy link
Copy Markdown
Contributor Author

Thank you for feedback @penelopeysm. Ready for the next round :)

@iago-lito
iago-lito force-pushed the enforce_triplequote_docstring branch 3 times, most recently from a1d8303 to bed39de Compare July 20, 2026 14:16
@iago-lito
iago-lito force-pushed the enforce_triplequote_docstring branch from bed39de to 9293094 Compare July 20, 2026 14:19

@penelopeysm penelopeysm left a comment

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.

This looks really good! I'll just run a regression test and if it doesn't make anything stupendously ugly we should be fine.

@penelopeysm

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@penelopeysm

Copy link
Copy Markdown
Member

ah darn I haven't made it use the cli app yet

@penelopeysm

Copy link
Copy Markdown
Member

!formatbot JuliaLang/julia@v1.12.6 v2_stable_multiline_strings=true format_docstrings=true

@github-actions

Copy link
Copy Markdown
Contributor

FormatBot Results

Description Value
FormatBot workflow run workflow run
Target repo JuliaLang/julia@v1.12.6
JuliaFormatter base 47b7618
JuliaFormatter PR 9293094
Options v2_stable_multiline_strings=true format_docstrings=true

Error: Formatting with base failed. See workflow run.

@penelopeysm

Copy link
Copy Markdown
Member

Okay, that's pretty annoying. Base Julia contains docstrings that contain invalid Julia code, so it can't format them. That's a separate error worth fixing, but I think I'll just trust the tests for now.

Finally, just some bikeshedding: I might do a slight rename to enforce_triplequoted_docstrings if that's ok.

@iago-lito

Copy link
Copy Markdown
Contributor Author

Totally ok. Thank you for support <3

@penelopeysm

Copy link
Copy Markdown
Member

Fab! Thank you so much for taking this on!

@penelopeysm
penelopeysm merged commit bc0896b into JuliaEditorSupport:master Jul 20, 2026
16 checks passed
@iago-lito

Copy link
Copy Markdown
Contributor Author

No worries. It did help a lot that you wrote which file to work on and that the changes would most likely be contained there :)

What's the usual release schedule?

@penelopeysm

Copy link
Copy Markdown
Member

Usually instantly, but there are a couple things I want to fix and bundle into a release, so hopefully later today.

@penelopeysm

Copy link
Copy Markdown
Member

v2.11.0 is released 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.

2 participants