all-contributors / all-contributors/app

@all-contributors PR are not `prettier` compliant

Open
#540 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
634
Forks
168
PR merge metrics
No merged PRs in 30d

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:

1. Ensure your repository has `pre-commit` configured with `prettier` as one of the hooks.
2. Use `@all-contributors` to add a contributor, opening a PR automatically.
3. The PR contains changes to `.all-contributorsrc` with multi-line arrays.
4. The CI pipeline runs `pre-commit run --all-files` and 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.