Conversation
… rules Adds two new lengths rules, LEN34 (too-many-required-arguments) and LEN35 (too-many-optional-arguments), which allow configuring separate limits for required and optional keyword arguments. The existing too-many-arguments (LEN07) rule is disabled by default in favor of the new rules. Co-authored-by: Bartlomiej Hirsz <bartek.hirsz@gmail.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
Looks good to me :) Thanks for pushing this across the finish line! |
This branch has not been deployed
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.
Adapts #1176 by @Lakitna to the current Robocop architecture (post robocop + robotidy merge) and re-opens it. Original authorship is preserved in the commit (authored by Sander van Beek).
Closes #1145
What changed
Adds two new
lengthsrules:too-many-required-arguments(LEN34) - default limitmax_args=5too-many-optional-arguments(LEN35) - default limitmax_args=10These allow configuring separate limits for required vs optional keyword arguments. As discussed in #1145, the existing
too-many-arguments(LEN07) rule is now disabled by default in favor of the two new rules.Notes on adaptation
The original PR targeted the old rule/checker structure. In the new style:
src/robocop/linter/rules/lengths.pywith acheck()method; wiring lives insrc/robocop/linter/checkers/test_case_keyword.py.LEN34/LEN35) instead of the old numeric0533/0534.tests/linter/rules/lengths/too_many_{required,optional}_arguments/and now also coverextendedoutput.docs/rules_list.mdregenerated.The main logic and test behavior mirror the original PR: required = arguments without a default, optional = arguments with a
}=default; the[Arguments]setting is highlighted (already the behavior ontoo-many-arguments).