-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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(general): number of words larger/less than or equal operators #3827
Conversation
…equals attribute solvers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice job, I wanted to ask in the other PR, if you also will implement greater and less flavours 😄 I also fixed linting and typing for you, expect you looked forward on doing it on you own 😉
checkov/common/checks_infra/solvers/attribute_solvers/base_number_of_words_attribute_solver.py
Show resolved
Hide resolved
...h/checks_infra/attribute_solvers/number_of_words_greater_than_or_equal_solver/test_solver.py
Outdated
Show resolved
Hide resolved
…kov into number-of-words-length
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noice 🍻
|
||
|
||
class NumberOfWordsGreaterThanOrEqualAttributeSolver(BaseNumberOfWordsAttributeSolver): | ||
operator = Operators.NUMBER_OF_WORDS_GREATER_THAN # noqa: CCE003 # a static attribute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's the wrong operator 🤔
|
||
|
||
class NumberOfWordsLessThanOrEqualAttributeSolver(BaseNumberOfWordsAttributeSolver): | ||
operator = Operators.NUMBER_OF_WORDS_GREATER_THAN # noqa: CCE003 # a static attribute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also here
…3827) * feat: add support for number_of_words_equals and number_of_words_not_equals attribute solvers * fix: fixed solver type issue * fix: using split() instead of split(" ") to handle multiple whitespaces as well * chore: renamed the attribute solver file names * feat: introducing for new operators number_of_words_greater/less_then_(or_equal)? * chore: user a base class for number_of_words operators * fix mypy and linting * fix: fixed typo in test names Co-authored-by: Mor Kadosh <[email protected]> Co-authored-by: gruebel <[email protected]>
…3827) * feat: add support for number_of_words_equals and number_of_words_not_equals attribute solvers * fix: fixed solver type issue * fix: using split() instead of split(" ") to handle multiple whitespaces as well * chore: renamed the attribute solver file names * feat: introducing for new operators number_of_words_greater/less_then_(or_equal)? * chore: user a base class for number_of_words operators * fix mypy and linting * fix: fixed typo in test names Co-authored-by: Mor Kadosh <[email protected]> Co-authored-by: gruebel <[email protected]>
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Description
Added support for four new operators:
number_of_words_greater_than
number_of_words_greater_than_or_equal
number_of_words_less_than
number_of_words_less_than_or_equal
Checklist: