databricks-cli/libs/dyn/yamlloader
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
..
testdata Add behavioral tests for examples from the YAML spec (#1835) 2024-10-17 13:13:30 +00:00
loader.go Enable errcheck everywhere and fix or silent remaining issues (#1987) 2024-12-11 13:26:00 +01:00
yaml.go Return `dyn.InvalidValue` instead of `dyn.NilValue` when errors happen (#1514) 2024-06-21 14:22:42 +00:00
yaml_anchor_test.go Define `dyn.Mapping` to represent maps (#1301) 2024-03-25 11:01:09 +00:00
yaml_error_test.go Define `dyn.Mapping` to represent maps (#1301) 2024-03-25 11:01:09 +00:00
yaml_mix_test.go Define `dyn.Mapping` to represent maps (#1301) 2024-03-25 11:01:09 +00:00
yaml_spec_test.go Add behavioral tests for examples from the YAML spec (#1835) 2024-10-17 13:13:30 +00:00
yaml_test.go Define `dyn.Mapping` to represent maps (#1301) 2024-03-25 11:01:09 +00:00