All Contributors should respect a .prettierrc if one is found
JoshuaKGoldberg opened this issue · 5 comments
Describe the bug
I have a .prettierrc
in a repo that indicates its .allcontributorsrc
file should be formatted as JSON with tabs. But the allcontributors bot is still formatting it as JSON with two spaces.
To Reproduce
Steps to reproduce the behavior:
- Create a new repo
- Create a
.pretterrc
file like https://github.com/JoshuaKGoldberg/template-typescript-node-package/blob/3b1bbc2b57a4ec40492d1e94814d3e48d9deb910/.prettierrc - Set up allcontributors
Expected behavior
Prettier settings should be applied when formatting the file.
That's an excellent point, do you know of any project or have a PoC that respects .prettierrc
?
Yup, the repo linked in the OP uses Prettier for formatting files. It has an explicit override to ignore .all-contributorsrc
because of this issue.
That makes sense! Do you have an idea of how the bot could appropriately take it into account?
In theory you can run npx prettier .all-contributorsrc --write
and that'll pick up whatever Prettier config is checked into the repo (as long as the bot has done at least a shallow clone).
I see, so it seems like something that could be integrated into the CLI (especially since the bot uses it to an extent).