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

Reject merge conflicts (backport #12237) #12239

Merged
merged 2 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 0 additions & 5 deletions doc/manual/src/language/operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,8 @@
[string]: ./types.md#type-string
[path]: ./types.md#type-path
[number]: ./types.md#type-float
<<<<<<< HEAD
[list]: ./types.md#list
[attribute set]: ./types.md#attribute-set
=======
[list]: ./types.md#type-list
[attribute set]: ./types.md#type-attrs
>>>>>>> 071ddbed5 (doc/manual: Fix some broken fragments)

<!-- TODO(@rhendric, #10970): ^ rationalize number -> int/float -->

Expand Down
21 changes: 21 additions & 0 deletions maintainers/flake-module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,27 @@
# https://flake.parts/options/pre-commit-hooks-nix.html#options
pre-commit.settings = {
hooks = {
# Conflicts are usually found by other checks, but not those in docs,
# and potentially other places.
check-merge-conflicts.enable = true;
# built-in check-merge-conflicts seems ineffective against those produced by mergify backports
check-merge-conflicts-2 = {
enable = true;
entry = "${pkgs.writeScript "check-merge-conflicts" ''
#!${pkgs.runtimeShell}
conflicts=false
for file in "$@"; do
if grep --with-filename --line-number -E '^>>>>>>> ' -- "$file"; then
conflicts=true
fi
done
if $conflicts; then
echo "ERROR: found merge/patch conflicts in files"
exit 1
fi
touch $out
''}";
};
clang-format = {
enable = true;
excludes = [
Expand Down
Loading