-
Notifications
You must be signed in to change notification settings - Fork 161
Description
Bug Report: Prettier causes CI to fail on PRs opened by all-contributors
Describe the bug
When @all-contributors opens a PR, if pre-commit runs in CI and includes prettier, the pipeline always breaks.
The reason is that the bot generates .all-contributorsrc with multi-line arrays for "files" and "contributions". Prettier automatically reformats these arrays into a single-line style, causing the CI to detect a change and fail. If pre-commit app runs in the repo, this will be fixed automatically, but, not everyone has the pre-commit app running in every single repo.
This behavior makes the repo maintainer to run pre-commit locally and push changes. This reduces the simplicity and magic of the @all-contributors bot.
Desired behavior: The bot should generate the contribution lists in a Prettier-compliant format (single-line arrays when possible), so that the PR passes CI without extra commits.
To Reproduce
Steps to reproduce the behavior:
- Ensure your repository has
pre-commitconfigured withprettieras one of the hooks. - Use
@all-contributorsto add a contributor, opening a PR automatically. - The PR contains changes to
.all-contributorsrcwith multi-line arrays. - The CI pipeline runs
pre-commit run --all-filesand fails due to Prettier reformatting.
Expected behavior
@all-contributors generates contribution arrays in a style that is already compliant with Prettier, so CI passes without manual intervention.
Screenshots
Not applicable.
Additional context
A workaround is to run pre-commit locally before merging the PR, or to add .all-contributorsrc to .prettierignore.
The long-term fix would be for the bot to respect Prettier formatting rules when generating contribution arrays.