You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Code cleanup and refactoring
Signed-off-by: Mario Vazquez <mavazque@redhat.com>
Co-authored-by: Claude <noreply@anthropic.com>
* Added CodeRabbit suggestions
Signed-off-by: Mario Vazquez <mavazque@redhat.com>
Co-authored-by: Claude <noreply@anthropic.com>
* Adds a section to agents.md on design decisions
Signed-off-by: Mario Vazquez <mavazque@redhat.com>
---------
Signed-off-by: Mario Vazquez <mavazque@redhat.com>
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: AGENTS.md
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -983,3 +983,20 @@ Before submitting new rules:
983
983
- [ ] `supporting_doc` is included when relevant documentation exists
984
984
- [ ] Rules are tested with real or realistic diff data
985
985
- [ ] No duplicate rules (check existing rules first)
986
+
987
+
## Conscious Design Choices
988
+
989
+
This section documents intentional design decisions that may be flagged by linters or code review tools. These are not defects -- they are deliberate choices with documented rationale.
990
+
991
+
### Ignoring `fmt.Fprint*` Errors in Report Generators
992
+
993
+
The text and reporting generators (`pkg/report/text.go`, `pkg/report/reporting.go`) call `fmt.Fprint`, `fmt.Fprintf`, and `fmt.Fprintln` without checking their return values. This is intentional.
994
+
995
+
**Why this is acceptable:**
996
+
997
+
- Ignoring `fmt.Fprint*` return values when writing CLI output to an `io.Writer` is idiomatic Go. The standard library tools (`go test`, `go vet`, `go fmt`) follow this same pattern, and neither `go vet` nor `golangci-lint` flag it.
998
+
- There are ~90 such calls in `text.go` and ~67 in `reporting.go`. Wrapping all of them with error-capturing wrappers (`writeErr` field, short-circuit checks, `g.write`/`g.writef`/`g.writeln` methods) would add significant structural complexity to what are currently clean, readable print functions.
999
+
- In the CLI context, a write failure to stdout causes `SIGPIPE`, terminating the process. A returned error would never reach a caller that could act on it.
1000
+
- The HTML generator uses `template.Execute` which handles write errors internally, but that is a fundamentally different pattern (single write call vs. many imperative prints). Comparing them is not meaningful.
1001
+
1002
+
**When to revisit:** If a future use case requires writing reports over a network connection or other unreliable transport where partial failure must be detected and handled, this decision can be revisited with a clear justification for the added complexity.
0 commit comments