Repository navigation
Conversation
Owner
|
Thank you for this. It's a careful fix, and the write-up made it easy to review. #153 was fixed on Your test covers cases the Closing this as superseded. Thanks again, and contributions are welcome on the other open issues. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
-print-configprinted the raw-attemptsflag value, so with no flags it showedattempts = "0" (default)while a scan uses 1. It now resolvesattemptsthe same way a scan does:resolveAttemptsis split into a pureeffectiveAttempts(same precedence rules, also reports whether-retrieswon) plus the existing deprecation warning, so-print-configcan reuse the logic without printing the warning.printConfigshows the effective value forattempts:1 (default)with nothing set, the-attemptsvalue when given, and the-retriesvalue marked e.g.(flag, from retries)/(env, from retries)when that is what wins. If the two conflict at the same precedence (which a scan refuses), the raw value is kept.Related Issue
Closes #153
Type of Change
Checklist
TestPrintConfigEffectiveAttemptsinmain_config_test.go: default,-attempts,-retries,SUBENUM_RETRIES, and flag-beats-env)go test ./...,go vet .,gofmt)I didn't run
make lint(golangci-lint isn't installed in my environment), so CI's lint job is the check there.Ethical Considerations
-print-config)Additional Information
Manual check:
go run . -print-confignow printsattempts = "1" (default), andgo run . -print-config -retries 2printsattempts = "2" (flag, from retries)without the deprecation warning.This change was prepared with AI assistance; I reviewed the diff and ran the tests above.