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 1 commit
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
21 changes: 13 additions & 8 deletions docs/updating.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,18 @@ 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 marks in your files:
12rambau marked this conversation as resolved.
Show resolved Hide resolved
```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 reject all the generated `.rej` files:
12rambau marked this conversation as resolved.
Show resolved Hide resolved

```yaml title=".pre-commit-config.yaml"
repos:
Expand All @@ -70,15 +81,9 @@ 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]
```

## Never change the answers file manually
Expand Down