databricks-cli/libs/cmdio
Denis Bilenko 8d5351c1c3
Enable errcheck everywhere and fix or silent remaining issues (#1987)
## Changes
Enable errcheck linter for the whole codebase.

Fix remaining complaints:
- If we can propagate error to caller, do that
- If we writing to stdout, continue ignoring errors (to avoid crashing
in "cli | head" case)
- Add exception for cobra non-critical API such as
MarkHidden/MarkDeprecated/RegisterFlagCompletionFunc. This keeps current
code and behaviour, to be decided later if we want to change this.
- Continue ignoring errors where that is desired behaviour (e.g.
git.loadConfig).
- Continue ignoring errors where panicking seems riskier than ignoring
the error.
- Annotate cases in libs/dyn with //nolint:errcheck - to be addressed
later.

Note, this PR is not meant to come up with the best strategy for each
case, but to be a relative safe change to enable errcheck linter.
  
## Tests
Existing tests.
2024-12-11 13:26:00 +01:00
..
context.go Add bundle destroy command (#300) 2023-04-06 12:54:58 +02:00
error_event.go Use cmdio logger to log bricks cmd execution errors (#348) 2023-04-24 12:11:52 +02:00
event.go Move state to event for whether they support inplace progress logging (#339) 2023-04-18 14:20:35 +02:00
io.go Use Go SDK Iterators when listing resources with the CLI (#1202) 2024-02-21 14:16:36 +00:00
io_test.go Do not allow input prompts in Git Bash terminal (#1069) 2023-12-18 15:01:59 +00:00
logger.go Enable errcheck everywhere and fix or silent remaining issues (#1987) 2024-12-11 13:26:00 +01:00
logger_test.go Add support for multiline descriptions when using template enums (#916) 2023-10-25 09:37:25 +00:00
message_event.go Log mutator messages using progress logger (#312) 2023-04-18 16:55:06 +02:00
render.go Enable errcheck everywhere and fix or silent remaining issues (#1987) 2024-12-11 13:26:00 +01:00
render_test.go Use Go SDK Iterators when listing resources with the CLI (#1202) 2024-02-21 14:16:36 +00:00
testing.go Prompt once for a client profile (#727) 2023-09-11 15:32:24 +00:00