From 10438e6cfd0f5cf742d518f129a0a9c43af9b7f0 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sun, 12 Jan 2025 13:50:55 +0100 Subject: [PATCH 1/2] Reject merge conflicts They're usually found by other checks, but docs would remain susceptible. (cherry picked from commit 29a1a21ce4448bc00c63d26a0c4238031c612cba) --- maintainers/flake-module.nix | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/maintainers/flake-module.nix b/maintainers/flake-module.nix index be91df536ad..e82ce102525 100644 --- a/maintainers/flake-module.nix +++ b/maintainers/flake-module.nix @@ -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 = [ From 1422832f7c5e9e642080474e4ea171225a1b68fb Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 15 Jan 2025 07:10:34 +0100 Subject: [PATCH 2/2] Resolve conflict Conflict introduced in 9ee4a85a9951ca3905e3fcf43695ecf0cf721712 --- doc/manual/src/language/operators.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/doc/manual/src/language/operators.md b/doc/manual/src/language/operators.md index a041f124b60..041bdc6e70f 100644 --- a/doc/manual/src/language/operators.md +++ b/doc/manual/src/language/operators.md @@ -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)