New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a CLI command to output the config that shall be used for a given file #794
Comments
There is already a 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 |
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: