databricks-cli/cmd/root
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
..
args.go Add usage string when command fails with incorrect arguments (#1276) 2024-03-12 14:12:34 +00:00
auth.go Improve token refresh flow (#1434) 2024-05-16 10:22:09 +00:00
auth_options.go Never load authentication configuration from bundle for sync command (#889) 2023-10-19 12:50:46 +00:00
auth_options_test.go Never load authentication configuration from bundle for sync command (#889) 2023-10-19 12:50:46 +00:00
auth_test.go Upgrade Go SDK to 0.44.0 (#1679) 2024-08-15 13:23:07 +00:00
bundle.go Improve `bundle validate` output (#1532) 2024-07-01 09:01:10 +00:00
bundle_test.go Add error checking in tests and enable errcheck there (#1980) 2024-12-09 13:56:41 +01:00
io.go Enable errcheck everywhere and fix or silent remaining issues (#1987) 2024-12-11 13:26:00 +01:00
logger.go Enable errcheck everywhere and fix or silent remaining issues (#1987) 2024-12-11 13:26:00 +01:00
progress_logger.go Enable errcheck everywhere and fix or silent remaining issues (#1987) 2024-12-11 13:26:00 +01:00
progress_logger_test.go Add error checking in tests and enable errcheck there (#1980) 2024-12-09 13:56:41 +01:00
root.go Extract functionality to detect if the CLI is running on DBR (#1889) 2024-11-14 16:10:45 +00:00
silent_err.go Improve `bundle validate` output (#1532) 2024-07-01 09:01:10 +00:00
user_agent.go Rename bricks -> databricks (#389) 2023-05-16 18:35:39 +02:00
user_agent_command.go Move code for including command name in user agent (#203) 2023-02-15 10:33:35 +01:00
user_agent_command_exec_id.go Add `cmd-exec-id` to user agent (#1808) 2024-11-01 14:08:09 +00:00
user_agent_command_exec_id_test.go Add `cmd-exec-id` to user agent (#1808) 2024-11-01 14:08:09 +00:00
user_agent_command_test.go Add `cmd-exec-id` to user agent (#1808) 2024-11-01 14:08:09 +00:00
user_agent_upstream.go Consolidate environment variable interaction (#747) 2023-09-11 08:18:43 +00:00
user_agent_upstream_test.go Let caller set BRICKS_UPSTREAM for user agent (#196) 2023-02-03 17:05:58 +01:00