r-lib / styler

Non-invasive pretty printing of R code
https://styler.r-lib.org
Other
703 stars 70 forks source link

Add pluralization + clickable hyperlink support #1186

Closed olivroy closed 3 months ago

olivroy commented 3 months ago

Addresses part of #1116.

For speed / usefulness, maybe should only hyperlink the files that changed? Support pluralization + clickable hyperlink

Demo (since #1187 is merged):

image

styler 1.10.2 image

github-actions[bot] commented 3 months ago

This is how benchmark results would change (along with a 95% confidence interval in relative change) if 634dce16918c4c8edcafbc2eb0083da04124ee72 is merged into main:

Further explanation regarding interpretation and methodology can be found in the documentation.

lorenzwalthert commented 3 months ago

I don’t get why this change would slow down the touchstone benchmark so much. One reason may be that you had an old version of the base branch. Compared to the previous release, after merging your previous PR, there is no sig officiant slow down.

https://github.com/r-lib/styler/pull/868#issuecomment-2023830195

so I merged the main branch into your branch now. Let’s see if the issue goes away.

olivroy commented 3 months ago

Will see. thanks for checking. Possibly that the repeated cli::format_Inline() calls slow things down. That's why I propose that maybe only do styling for files that changed?

github-actions[bot] commented 3 months ago

This is how benchmark results would change (along with a 95% confidence interval in relative change) if 208d9c7abb4eb44436695a68a19ea979c99ce921 is merged into main:

Further explanation regarding interpretation and methodology can be found in the documentation.

olivroy commented 3 months ago

Don't really know how to make sure speed + width is preserved. Closing