Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

cli/config: some minor cleanups #6352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
thaJeztah wants to merge 2 commits into docker:master
base: master
Choose a base branch
Loading
from thaJeztah:cleanup_config

Conversation

@thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Aug 23, 2025

I have some more changes in this area, but need to dust it off; let's open these already as a PR 😅

cli/config/configfile: inline getConfiguredCredentialStore

It was a premature abstraction; the "nil" check for the map was redundant,
making it literally a 1-liner, so just inline it.

cli/config/configfile: use more idiomatic receiver name

Use a shorter name, which is more idiomatic, and prevents accidental
shadowing of types or arguments.

- Human readable description for the release notes

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah thaJeztah added this to the 29.0.0 milestone Aug 23, 2025
@thaJeztah thaJeztah added status/2-code-review kind/refactor PR's that refactor, or clean-up code labels Aug 23, 2025
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@thaJeztah thaJeztah marked this pull request as draft August 23, 2025 00:32
Copy link
Member Author

Hm... I messed up something;

#18 64.05 === FAIL: cli/config/configfile TestGetAllCredentialsCredsStore (0.00s)
#18 64.05 file_test.go:238: assertion failed: 
#18 64.05 --- expected
#18 64.05 +++ authConfigs
#18 64.05 map[string]types.AuthConfig{
#18 64.05 - 	"example.com": {Username: "user", Password: "pass"},
#18 64.05 }
#18 64.05 
#18 64.05 file_test.go:239: assertion failed: 1 (int) != 0 (testCredsStore.(*mockNativeStore).GetAllCallCount int)
#18 64.05 
#18 64.05 === FAIL: cli/config/configfile TestGetAllCredentialsCredStoreAndCredHelper (0.00s)
#18 64.05 file_test.go:402: assertion failed: 
#18 64.05 --- expected
#18 64.05 +++ authConfigs
#18 64.05 map[string]types.AuthConfig{
#18 64.05 	"credhelper.com": {Username: "cred_helper_user", Password: "cred_helper_pass"},
#18 64.05 - 	"credstore.com": {Username: "cred_store_user", Password: "cred_store_pass"},
#18 64.05 }
#18 64.05 

It was a premature abstraction; the "nil" check for the map was redundant,
making it literally a 1-liner, so just inline it.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Use a shorter name, which is more idiomatic, and prevents accidental
shadowing of types or arguments.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

kind/refactor PR's that refactor, or clean-up code status/2-code-review

Projects

None yet

Milestone

29.2.0

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /