-
Notifications
You must be signed in to change notification settings - Fork 7
EQS-563 Enable COPYPASTE megalinter checks #314
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
base: main
Are you sure you want to change the base?
Conversation
| "code": "1e", | ||
| }, | ||
|
|
||
| def base_additional_answer_codes(): |
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.
Simpler to just have a const list instead of function and removing the "base" since those are just "additional answer codes"?
|
|
||
| def test_duplicate_answer_codes(): | ||
| filename = "schemas/valid/test_answer_codes.json" | ||
| def base_checkbox_answer_codes(): |
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.
Can we simplify it and call it "checkbox_answer_codes"?
|
|
||
| expected_error_messages = [ | ||
| { | ||
| "message": CalculatedSummaryBlockValidator.ANSWERS_MUST_HAVE_SAME_TYPE, |
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.
What happened to these 3 errors below? Have they been removed?
| json_to_validate = _open_and_load_schema_file(filename) | ||
|
|
||
| expected_error_messages = [ | ||
| def base_error_messages(): |
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 would prefer if we follow the convention in the codebase and define it as a top-level constant variable, using uppercase letters (this is just a convention, not enforced). Also, there is only one error message here and not sure if it should be called "base"? It's specific error: "answer same type error message".
| ) | ||
| from tests.utils import _open_and_load_schema_file | ||
|
|
||
| radio_answers = [ |
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.
Can we make these constants (uppercase names)? Since they are top level?
Motivation and Context
Changes enable the COPYPASTE megalinter checks, and resolve flagged issues
What has changed
Code changes to remove various code duplication issues in test files.
How to test?
Ensure that tests, linters and megalinter checks all pass
Links
EQS-563