Skip to content
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

docs: improve updating pre-commit documentation #1361

Merged
merged 5 commits into from
Jan 15, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 22 additions & 8 deletions docs/updating.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,21 @@ setting you use.

## Preventing Commit of Merge Conflicts

If you use `--conflict rej` (the default):
If you use `--conflict inline` (the default) then you need to check for conflicts
markers in your files:

```yaml title=".pre-commit-config.yaml"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
# Prevent committing inline conflict markers
- id: check-merge-conflict
args: [--assume-in-merge]
```

If you use `--conflict rej` then you need to review and remove all generated `.rej`
files:

```yaml title=".pre-commit-config.yaml"
repos:
Expand All @@ -70,17 +84,17 @@ repos:
# Prevent committing .rej files
- id: forbidden-files
name: forbidden files
entry: found Copier update rejection files; review them and remove them
entry: found Copier update rejection files; review and remove them before merging.
yajo marked this conversation as resolved.
Show resolved Hide resolved
language: fail
files: "\\.rej$"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
# Prevent committing inline conflict markers
- id: check-merge-conflict
args: [--assume-in-merge]
```

!!! note

For shared project that use both "rej" and "inline" depending on the user,
you can add both repo to you `pre-commit-config.yaml` file, making sure that none
of these files are committed.
yajo marked this conversation as resolved.
Show resolved Hide resolved

## Never change the answers file manually

!!! important
Expand Down
Loading