You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently I made a change to Canva's dprint config so that we used dprint-plugin-ruff to format our python code. However I didn't realise that I had accidentally turned off all python formatting in the codebase with my change because I'd forgotten to add associations to the config.
When I ran the formatter with --verbose I saw dprint instantiate dprint-plugin-ruff and it looked like it formatted all of the files.
But it turned out that without associations dprint was only running isort (via dprint-plugin-exec) on the files.
It wasn't until a python dev let me know that their code had violated line length without being formatted did we realise my mistake.
It would be great if there was a way to dump the config for a specific file to help validate that everything is setup as expected. I'd expect such a command to resolve all associations and includes/excludes and dump just the expected configs for the plugins that will be run.
For example eslint has --print-config <file> which will do all of the config resolution and work until just before the lint run actually starts and then prints the config and exits.
The text was updated successfully, but these errors were encountered:
There is already a dprint output-resolved-config sub command. Perhaps that could accept a file path as well and the returned config would be limited to only the plugins being formatted. I'm not sure if it should just be another arg or most likely a flag (not sure about a name).
By the way, what I always do to test that is just open a file, add some spaces, then re-run the formatter.
Yeah in hindsight that's what I should have done. And is what I did to verify my fix actually fixed things.
I just ran dprint with verbose mode and saw it had python files and the format time was sane and I stopped there.
And because the codebase was already formatted there ofc weren't CI failures.
Now that I've correctly configured it I can see dprint outputs logs differently if two plugins are running on a file!
Yeah I tried using output-resolved-config but because the plugin is actually configured it shows up there. The issue was that it wasn't associated with python files. Tricky nuance to the config!
Recently I made a change to Canva's dprint config so that we used
dprint-plugin-ruff
to format our python code. However I didn't realise that I had accidentally turned off all python formatting in the codebase with my change because I'd forgotten to addassociations
to the config.When I ran the formatter with
--verbose
I saw dprint instantiatedprint-plugin-ruff
and it looked like it formatted all of the files.But it turned out that without
associations
dprint was only runningisort
(viadprint-plugin-exec
) on the files.It wasn't until a python dev let me know that their code had violated line length without being formatted did we realise my mistake.
It would be great if there was a way to dump the config for a specific file to help validate that everything is setup as expected. I'd expect such a command to resolve all associations and includes/excludes and dump just the expected configs for the plugins that will be run.
For example eslint has
--print-config <file>
which will do all of the config resolution and work until just before the lint run actually starts and then prints the config and exits.The text was updated successfully, but these errors were encountered: