moonrepo / moon

A build system and monorepo management tool for the web ecosystem, written in Rust.
https://moonrepo.dev/moon
MIT License
2.81k stars 154 forks source link

[feature] support post processing on commands that modify files #1546

Open rhuanbarreto opened 2 months ago

rhuanbarreto commented 2 months ago

Is your feature request related to a problem? Please describe.

When you run moon ci, it automatically runs moon sync projects for you so the tsconfig and package json files are in sync. The problem is that doing this will make linters like prettier fail due to formatting changes.

Describe the solution you'd like

I would like to have a config in toolchain.yaml that allows me to run a post-sync task that would format the files automatically.

Describe alternatives you've considered

For now CI/Checks would fail and you would need to fix it manually.

milesj commented 2 months ago

@rhuanbarreto The next version of moon will try and preserve the indentation, so will probably help a lot in this scenario.

milesj commented 1 month ago

Ok try 1.27!

rhuanbarreto commented 1 month ago

Still not working fully. For some parts it worked.

Screenshot 2024-07-16 at 15 25 35

After prettier:

Screenshot 2024-07-16 at 15 26 43
milesj commented 1 month ago

do the files formatting get changed every time you run a task? it should only happen if we determine the content needs to change.

rhuanbarreto commented 1 month ago

Only if you change the file.