databricks-cli/cmd
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
..
account Bump github.com/databricks/databricks-sdk-go from 0.51.0 to 0.52.0 (#1931) 2024-11-28 15:33:51 +00:00
api Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
auth Enable errcheck everywhere and fix or silent remaining issues (#1987) 2024-12-11 13:26:00 +01:00
bundle Enable errcheck everywhere and fix or silent remaining issues (#1987) 2024-12-11 13:26:00 +01:00
configure Fix `databricks configure` to use DATABRICKS_CONFIG_FILE environment variable if exists as config file (#1325) 2024-06-24 10:56:49 +00:00
fs Consolidate test helpers for `io/fs` (#1906) 2024-11-15 15:37:21 +00:00
labs Add error checking in tests and enable errcheck there (#1980) 2024-12-09 13:56:41 +01:00
root Enable errcheck everywhere and fix or silent remaining issues (#1987) 2024-12-11 13:26:00 +01:00
sync Properly read Git metadata when running inside workspace (#1945) 2024-12-05 10:13:13 +00:00
version Add usage string when command fails with incorrect arguments (#1276) 2024-03-12 14:12:34 +00:00
workspace Bump github.com/databricks/databricks-sdk-go from 0.51.0 to 0.52.0 (#1931) 2024-11-28 15:33:51 +00:00
cmd.go Upgrade Go SDK to 0.44.0 (#1679) 2024-08-15 13:23:07 +00:00