Skip to content

allow checking formatting with cache#1830

Merged
belav merged 2 commits intobelav:mainfrom
sd-st:faster-check
Mar 22, 2026
Merged

allow checking formatting with cache#1830
belav merged 2 commits intobelav:mainfrom
sd-st:faster-check

Conversation

@sd-st
Copy link
Copy Markdown
Contributor

@sd-st sd-st commented Mar 10, 2026

Description

I run csharpier check as part of my lint flow, which means I run it a lot. On one of my repositories it takes 200ms to run format and 8000ms to run check. This PR allows for check to use the cache (although it can be disabled, just like for format)

Related Issue

Checklist

  • My code follows the project's code style
    • always var
    • follow existing naming conventions
    • always this.
    • no pointless comments
  • I will not force push after a code review of my PR has started
  • I have added tests that cover my changes

@sd-st
Copy link
Copy Markdown
Contributor Author

sd-st commented Mar 10, 2026

I think there's probably nothing to test here; it doesn't look like there were tests for the previous behaviour (and no tests for the CLI arguments in general as far as I can tell)

belav added a commit that referenced this pull request Mar 14, 2026
Copy link
Copy Markdown
Owner

@belav belav left a comment

Choose a reason for hiding this comment

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

My worry with this change is that I had a commit to specifically disable the cache when running check, but I don't recall why I would have made that change and neglected to leave a comment explaining why.

81c36d7

It seems safer to have a new option for the check command --use-cache so that it can default to the current behavior.

@sd-st sd-st requested a review from belav March 16, 2026 13:47
@sd-st
Copy link
Copy Markdown
Contributor Author

sd-st commented Mar 16, 2026

I do think it's a little unfortunate to have a different API surface between checking and formatting but I made that change

@belav belav added this to the 1.3.0 milestone Mar 22, 2026
Copy link
Copy Markdown
Owner

@belav belav left a comment

Choose a reason for hiding this comment

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

Thanks for updating. I was thinking that running the check command in a GH action may have had issues with using the cache. That might be why I disabled it for the check command.

@belav belav merged commit b12955b into belav:main Mar 22, 2026
7 checks passed
@sd-st
Copy link
Copy Markdown
Contributor Author

sd-st commented Mar 23, 2026

Thanks! I'm planning to try it out in CI so I'll report back if there are any issues.

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