refactor: split ConfigureOrCheckCommand into multiple functions#222
Merged
ahmad-ibra merged 3 commits intomainfrom Sep 11, 2024
Merged
refactor: split ConfigureOrCheckCommand into multiple functions#222ahmad-ibra merged 3 commits intomainfrom
ahmad-ibra merged 3 commits intomainfrom
Conversation
5864f71 to
dc10ec6
Compare
dc10ec6 to
2857ac3
Compare
TylerGillson
requested changes
Sep 11, 2024
Member
TylerGillson
left a comment
There was a problem hiding this comment.
Sorry... DRY nazi here. Please put:
ok, invalidPlugins := vc.EnabledPluginsHaveRules()
if !ok {
log.FatalCLI("invalid validator configuration", "error",
fmt.Sprintf("the following plugins are enabled, but have no rules configured: %v", invalidPlugins),
)
}Into a helper.
TylerGillson
approved these changes
Sep 11, 2024
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## main #222 +/- ##
=======================================
Coverage 53.30% 53.30%
=======================================
Files 46 46
Lines 6339 6352 +13
=======================================
+ Hits 3379 3386 +7
- Misses 2114 2117 +3
- Partials 846 849 +3
Continue to review full report in Codecov by Sentry.
|
TylerGillson
added a commit
that referenced
this pull request
Sep 12, 2024
🤖 I have created a release *beep* *boop* --- ## [0.2.1](v0.2.0...v0.2.1) (2024-09-11) ### Features * support for Azure quota rule ([#224](#224)) ([8e61091](8e61091)) ### Bug Fixes * ignore nil errors in validationResponseOk ([#227](#227)) ([26544e2](26544e2)) ### Refactoring * split ConfigureOrCheckCommand into multiple functions ([#222](#222)) ([466413a](466413a)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Signed-off-by: Tyler Gillson <tyler.gillson@gmail.com>
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.
Issue
N/A
Description
Breaks the
ConfigureOrCheckCommandfunction down into aConfigureCommandfunction and aCheckCommandfunction. Also introduces a newconfigureValidatorConfighelper function.With this change, the cognitive load of modifying either the
ConfigureCommandorCheckCommandfunctions should be reduced because we no longer need to keep both direct evaluation and continuous evaluation in mind.