ktfmt icon indicating copy to clipboard operation
ktfmt copied to clipboard

Different result for ktfmtFormat on Windows vs. OSX

Open hamen opened this issue 1 year ago • 6 comments

Hi all 😀

We are using ktfmtFormat in Jewel (https://github.com/JetBrains/jewel) and we are seeing different behaviors on Windows and OSX.

Running ktfmtFormat on this commit https://github.com/JetBrains/jewel/actions/runs/10919605303/job/30307618757 on Windows will produce no changes to any files, and then when the CI runs check will error out with:

Execution failed for task ':ide-laf-bridge:ktfmtCheckMain'.
> [ktfmt] Found 1 files that are not properly formatted:
  src/main/kotlin/org/jetbrains/jewel/bridge/theme/IntUiBridge.kt

Running ktfmtFormat on Mac will change a couple of files, as shown in this commit https://github.com/JetBrains/jewel/pull/601/commits/c322d7b6b904eff7576d0bd13fa3f438befdf5ee?file-filters%5B%5D=.kt&show-viewed-files=true, rearranging a few import statements. Running check on the CI will then succeed.

Thank you.

hamen avatar Sep 18 '24 15:09 hamen

Hi @hick209 any chance y'all can take a look at this? @hamen can help you repro by providing more Jewel commits where this happens. It's very annoying...

rock3r avatar Nov 25 '24 14:11 rock3r

Yeah, it forced me to a very exhausting workflow where I need to:

  • run it on Windows
  • push the code
  • watch the CI failing
  • pull the branch on Linux
  • run it on Linux
  • push the code
  • watch the CI succeed

It's very time-consuming.

hamen avatar Nov 25 '24 14:11 hamen

Yes, @rock3r, please do share more commits where this happens and what is lacking. Unfortunately I don't have a Windows machine to easily test this 🫤

hick209 avatar Jan 10 '25 20:01 hick209

@hamen ⬆️

rock3r avatar Jan 10 '25 20:01 rock3r

I'm thinking this might be related to https://github.com/facebook/ktfmt/issues/523 since I suspect that issue happens only on Windows

hick209 avatar Jan 10 '25 20:01 hick209

I'll link some commit next week once I get back to Jewel 👍🏻

hamen avatar Jan 11 '25 07:01 hamen

@hamen any success on recently reproducing this?

hick209 avatar May 21 '25 10:05 hick209

Hi @hick209, I'm not using the tool anymore. I can't give you any other feedback on it.

hamen avatar May 21 '25 11:05 hamen

@rock3r let me know if you are still experiencing issues with this, else I'll close it

hick209 avatar May 21 '25 12:05 hick209

Ivan was the only one using Windows regularly... I'd close for now. If it comes back we'll file a new one

rock3r avatar May 21 '25 13:05 rock3r