Commit 0dd4678
committed
fix(incident): satisfy golangci-lint and stop pinning verification prose in tests
Two issues found in review, both against the same code:
1. golangci-lint (default set, staticcheck ST1005) flags the verification
error for ending in punctuation. Extract the shared guidance sentence and
the per-incident "not found" detail into named constants
(commentVerificationGuidance, commentVerificationNotFoundDetailFmt) and
drop the trailing period, matching this repo's existing convention for
multi-sentence errors (args.go, root.go): internal periods are fine, a
trailing one is not.
2. That extraction also fixes a test-design problem: the transport-error and
not-found tests were each asserting a hand-copied fragment of the
guidance sentence, so editing the prose in one place silently broke tests
elsewhere — exactly what happened moving from "do not retry this command
against the full batch" to "Do not write the comment again" earlier in
this branch. Both tests now assert against the same
commentVerificationGuidance symbol the production code emits, so a future
reword of the constant keeps every caller in sync automatically instead of
requiring a hunt for hand-duplicated copies. Also strengthened the
transport-error test to assert the passing incident is NOT named as a
problem, mirroring the batch test's coverage.
Verified against golangci-lint v2.11.0 (matching .github/workflows/lint.yml
exactly, not just whatever was already on PATH): 0 issues.1 parent e71af6c commit 0dd4678
2 files changed
Lines changed: 39 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
765 | 765 | | |
766 | 766 | | |
767 | 767 | | |
768 | | - | |
769 | | - | |
| 768 | + | |
| 769 | + | |
770 | 770 | | |
771 | 771 | | |
772 | 772 | | |
773 | 773 | | |
774 | | - | |
775 | | - | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
776 | 779 | | |
777 | 780 | | |
778 | 781 | | |
| |||
793 | 796 | | |
794 | 797 | | |
795 | 798 | | |
796 | | - | |
| 799 | + | |
797 | 800 | | |
798 | 801 | | |
799 | 802 | | |
| |||
908 | 911 | | |
909 | 912 | | |
910 | 913 | | |
911 | | - | |
| 914 | + | |
912 | 915 | | |
913 | | - | |
914 | | - | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
915 | 925 | | |
916 | 926 | | |
917 | 927 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
948 | 948 | | |
949 | 949 | | |
950 | 950 | | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
951 | 969 | | |
952 | 970 | | |
953 | 971 | | |
| |||
993 | 1011 | | |
994 | 1012 | | |
995 | 1013 | | |
996 | | - | |
| 1014 | + | |
997 | 1015 | | |
998 | 1016 | | |
999 | 1017 | | |
1000 | 1018 | | |
1001 | 1019 | | |
1002 | | - | |
1003 | | - | |
1004 | | - | |
1005 | | - | |
1006 | | - | |
1007 | | - | |
| 1020 | + | |
| 1021 | + | |
1008 | 1022 | | |
1009 | 1023 | | |
1010 | 1024 | | |
| |||
0 commit comments