databricks-cli/cmd/root
shreyas-goenka 10b245d10c
Move `ConfigUsed` to `libs/command` (#2440)
## Changes
This PR moves `ConfigUsed` from the root package to `libs/command`.

## Why
Having the ConfigUsed function in the root package is a problem because
that means we cannot use that function from outside the `root` package
since doing so often leads to an import cycle (because `root` imports
everything implicitly).

Moving it to a separate package that consolidates the read interaction
and solves the import cycle issue. Example where this would have
simplified code:
https://github.com/databricks/cli/pull/2432#discussion_r1983368092

I'd like to send PRs to do the same for the workspace client and account
client as well. I'll wait however until this one is merged incase people
have concerns about the approach here.

## Tests
Existing tests.
2025-03-06 17:08:55 +00:00
..
args.go Add usage string when command fails with incorrect arguments (#1276) 2024-03-12 14:12:34 +00:00
auth.go Move `ConfigUsed` to `libs/command` (#2440) 2025-03-06 17:08:55 +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 Enable gofumpt and goimports in golangci-lint (#1999) 2024-12-12 10:28:42 +01:00
bundle.go Move `ConfigUsed` to `libs/command` (#2440) 2025-03-06 17:08:55 +00:00
bundle_test.go Move `ConfigUsed` to `libs/command` (#2440) 2025-03-06 17:08:55 +00:00
io.go Remove calls to `t.Setenv` from integration tests (#2018) 2024-12-16 12:34:37 +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 perfsprint linter and apply autofix (#2071) 2025-01-07 10:49:23 +00: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 Recover from panic gracefully (#2353) 2025-02-27 13:27:36 +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 Enable gofumpt and goimports in golangci-lint (#1999) 2024-12-12 10:28:42 +01:00
user_agent_upstream_test.go Let caller set BRICKS_UPSTREAM for user agent (#196) 2023-02-03 17:05:58 +01:00