-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat(commands): Add Commands to list White and Blacklists #137
Merged
Conversation
This file contains 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
9c08755
to
d86136a
Compare
d86136a
to
0ff7f0a
Compare
The EventCheckerCommand has been simplified by extracting command handling into a separate method. The command had previously only allowed listing of 'all' events. Now the 'list' command accepts 'all', 'blacklist', and 'whitelist' as parameters. EventCheckerCommandCompleter code was updated accordingly to reflect these changes.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #137 +/- ##
============================================
- Coverage 79.52% 71.67% -7.86%
- Complexity 41 56 +15
============================================
Files 6 6
Lines 127 173 +46
Branches 18 29 +11
============================================
+ Hits 101 124 +23
- Misses 11 27 +16
- Partials 15 22 +7 ☔ View full report in Codecov by Sentry. |
This update refactors the EventCheckerCommand to simplify its structure and enhance its functionality. By creating a separate 'sendEvents' method, redundant code is eliminated. Moreover, the 'list' command now accepts three parameters - 'all', 'blacklist', and 'whitelist' - improving navigation through different event categories.
This commit improves the structure and functionality of the EventCheckerCommand in the Kotlin codebase. It introduces a new 'handleNonExistentPage' method to remove duplicated code and simplify error handling. Additionally, the 'list' command now handles three parameters more efficiently, improving user navigation within event categories.
This commit introduces a helper method 'handlePartition' to simplify management of partitions in the EventCheckerCommand. It replaces redundant code in both blacklist and whitelist sections, improving readability and maintainability of the code. The 'partition' variable is checked using a more idiomatic call, 'isEmpty()', enhancing code clarity.
Introduced methods 'handleEmptyPartition' and 'isListTypeEnabled' to simplify validation of list types and corresponding partitions. This refactoring enhances the readability and maintainability by eliminating repetitive code for 'all', 'blacklist', and 'whitelist' list types. It also improves the handling and messaging around empty or disabled list types.
The error message in the EventCheckerCommand class and the EventCheckerCommandTest class has been updated to include all, blacklist, and whitelist as options for the list command. This update ensures a more accurate and helpful error message to guide the user when using the 'list' command.
|
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.
No description provided.