-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Fix part of issue #8423 Lint concatenation checker #19908
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
Fix part of issue #8423 Lint concatenation checker #19908
Conversation
Hi @Helper2020, can you complete the following:
|
Assigning @vojtechjelinek for the first pass review of this PR. Thanks! |
Unassigning @Helper2020 since a re-review was requested. @Helper2020, please make sure you have addressed all review comments. Thanks! |
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.
Thanks @Helper2020! Could you please fix the lint checks that are failing on CI? Thanks.
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.
Thanks! Left a few comments.
scripts/linters/pylint_extensions.py
Outdated
if (isinstance(left_inferred.value, str) and | ||
isinstance(right_inferred.value, str)): | ||
self.add_message('prefer-string-interpolation', node=node) |
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.
if (isinstance(left_inferred.value, str) and | |
isinstance(right_inferred.value, str)): | |
self.add_message('prefer-string-interpolation', node=node) | |
if ( | |
isinstance(left_inferred.value, str) and | |
isinstance(right_inferred.value, str) | |
): | |
self.add_message('prefer-string-interpolation', node=node) |
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.
Done.
Unassigning @vojtechjelinek since the review is done. |
@Helper2020 please correct the issues flagged by Oppiabot in #19908 (comment):
I'm de-assigning myself for now until these issues and CI checks are fixed |
@vojtechjelinek I'm not sure how I can handle errors from .infer() without try-except blocks. Any suggestions? |
Why can't you use try-except? |
I can, just according to the coding style guide, raising exceptions are rarely used. |
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.
PTAL @vojtechjelinek, PTAL @U8NWXD
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.
Sorry for the late reply. LGTM for my codeowner files, thanks @Helper2020!
@Helper2020 Just a note, follow the syntax in the "essential checklist" if you want to assign reviewers, otherwise Oppiabot might not recognize it. I think the "PTAL" comes at the end not at the beginning. |
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.
Thanks! Just one nit.
score_category = ('%s%s%s' % ( | ||
suggestion_models.SCORE_TYPE_CONTENT, | ||
suggestion_models.SCORE_CATEGORY_DELIMITER, exploration.category | ||
)) |
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.
score_category = ('%s%s%s' % ( | |
suggestion_models.SCORE_TYPE_CONTENT, | |
suggestion_models.SCORE_CATEGORY_DELIMITER, exploration.category | |
)) | |
score_category = ('%s%s%s' % ( | |
suggestion_models.SCORE_TYPE_CONTENT, | |
suggestion_models.SCORE_CATEGORY_DELIMITER, exploration.category | |
)) |
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.
ditto below
Unassigning @vojtechjelinek since they have already approved the PR. |
Unassigning @U8NWXD since they have already approved the PR. |
@U8NWXD For some reason the bot removed the pr from the merge queue. |
* Added string concatentation class checker * Added string concatenation checker tests * Refactored String concatenation checker class * Fixed linting issues * Fixed symolic name conflict * Fixed linting issues * Fixing linting issues in pylint extenstions test file * Fixed any type error * Added try-except block and test case for inference errors * Shorted message id name * Added test case, one side str and other side is not * Fixed linting issues * Fixed linting issue email_services.py * Fixed refactor message strings email_services.py * removed string concactenations learner_group_test * Fixed string concatenation issues in acl_decorators_test.py * Fixed string concacention issue in cron_test.py * implemented suggestions cron_test.py * Implemented suggested changes in acl_decorators_test.py * Removed string concatenations in favor of string intropolations in state_domain_test.py * Replace string concatenations with string intropolation from stats_domain_test.py * Removed string concatenation in favor of string intropolation in general_purpose_linter.py * Removed string concactenation app_feedback_report_domain_test.py * Removed String concatenations from email_manager_test.py * Removed string concatenation in test_utils.py * Removed string concatenation in blog_domain_test.py * Removed string concatenation from story_domain * Removed string concantentations from tasks_test.py * Removes string concantentions in admin.py * Removed string concatentation from html.linter.py * Removed string concatenation in gae_models_test * Removed string concatenations from run_frontend_tests_test.py * Removed string concatenations from suggestion_registry_test.py * Removed string concatenation from feedback_domain_test * Removed string concatenations from email_manager.py * Removed string concatenations from story_node_jobs_test.py * Removed string concatenations from resourse_test * Removed string concatenation from exp_domain.py * Removed string concatactenation from topic_editor.py * Removed string concatenation js_ts_linter.py * Removed string concantenation from blog_domin.py * Removed string concatenation from utils_test.py * Removed string concatenation from dev_mode_email_services_test.py * Removed string concatenation from story_fetchers_test.py * Removed string concatenation from start.py * Removed string concatenation from contributor_dashboard_test.py * Removed string concatenation from feature_flag_services_test * Removed string concatenation from skill_domain_test * Removed string concatenation from generators_test.py * Removed string concatenation from dev_mode_email_services/py * Removed string concatenation from story_services.py * Fixed invalid data type error in test_util.py * Removed string concatenation from user_services_test.py * Removed string concatenation from question_domain.py * Removed string concatenation from profile.py * Removed string concatenations from exp_migration_jobs_test.py * Removed string concatenations from common.py * Minor refactor * Removed string concatenations from collection_domain.py * Removed string concatenations from profil_test.py * Removed string concatenations from update_configs.py * Removed string concatenation from acl_decorators.py * Removed string concatenations from blog_services_test * Removed string concatenation from platform_parameter_domain_test.py * Removed string concatenation from admin_test.py * Removed string concatenation from collection_services_test.py * Removed string concatenations from stetup_test.py * Removed string concatenations from check_overall_backend_test_coverage_test * Removed string concatenations from skill_mastery_test.py * Removed string concatenations email_services_test.py * Removed string concatenations gae_models_test * Removed string concatenation reader_test.py * Removed string concatenations run_typescript_checks.py * Removed string concatenations question_editor.py * Removed string concatenation contributor_admin_stats_job_test.py * Removed string concatenation base_test.py * Removed string concatenation gae_app_identity_services.py * Removed string concatenations takeout_service_test.py * Removed string concatenation story_domain_test.py * Removed string concatenation objects.py * Removed string concatenation topic_editor_test.py * Removed string concatenation story_services_test * Removed string concatenation run_frontend_tests.py * Removed string concatenations js_ts_linter_test.py * Added feature to string concanation linter to ignore datetime object * Fixed linting errors in pylint_extensions.py * Removed string concatenations feedback_services_test.py * Removed string concatenations linter_utils_test.py * Fixed linting errors in pylint_extensions_test.py * Removed string concatenations topics_and_skills_dashboard * Removed string concatenations suggestions_services_test/py * Removed string concatenations exp_services_test.py * Removed string concatenation from TextInput.py * Removed string concatenations from suggestion_services.py * Removed string concatenation gae_models.py * Fixed linting errors in gae_models.y * Removed string concatenation from summary_services_test.py * Implented suggested changes in pylint_extensions_test.py * Removed string concatenation from story_fetchers_test * Removed string concatenations suggestion_services_test.py * Removed white space from suggestion_services_test.py * Updated lint-concatenation message id and next message id value * Removed string concatenations from suggestion_test.py * Removed string concatenation suggestion_edit_state_contented_deletion_jobs.py * Removed string concatenation from common.py * Removed string concatenation user_validation_jobs_test.py * Removed string concatenation skill_mastery_test * Removed string concatenation reader_test/py * Removed string concatenations suggestion_edit_state_content_jobs_test.py * Fixed spacing in acl_decorators_test.py * Rephrased String concantenation checker message * Changed test function names in PreventStringConcatenationCheckerTests * deindent 4 spaces to match scope' * Indented by 4 to match scope * Refactor code * Implemented suggestions * Implemented suggested changes * Refactor line of code in js_ts_linter.py * Removed redudant occurances of the word of * Fixed string interpolation error * Refactored pylint_extensions because of missing coverage * Refactored code based on suggestions * Implemented suggested changes * Implemented suggested changes * Refactored code * Refactored code * Refactored code * Refactored code * refactored code * Refactored code * Refactored code in collection_domain.py * Refactored code exp_domain.py * Refactored code exp_services_test.py * Refactored code * Refactored code in platform_parameter_domain_test.py * Refactored code in skill_domain_test.py * Refactored code * Refactored code in collection_domain.py * Refactored string in story_domain_test.py * refactored string in story_fetchers_test * Refactored code in story_services_test * Refactored code in suggestion_registry_test * Refactor code suggestions_services_test * Refactored code in summary_services_test * Refactored code takeout_service_test * Refactored strings * Refactored strings * Refactored strings * Refactored strings * Refactored strings * Refactore strings * Refactored string * Refactored string * Refactored Strings * Refactored string in setup_test.py * Refactored strings in stetup_test.py * Refactored string in start.py * Fixed linting errors * Fixed skill_domain_test error * Refactored code in suggestion_test.py * Refactored string in task_test.py * Refactored String * Refactored email_manager_test * Refactores trings feedback_services_test.py * Refactored string story_domain.py * Refactored sring in suggestions_services_test.py * Implemented suggestions in story_services.py * Fixed idenation error * Refactored string in email_manager.py * Refactored code suggestion_services.py * Refactored code user_services_test.py * Refactored code TextInput.py * Refactored code in base_test * Refactored code in objects.py * Fixed linting issues in TextInput.py and base_test.py * Implemented suggestion for PreventStringConcatenationCheckerTest * Changed test function name in pylint_extensions_test * Indented part of string for readability in commpn.py * Refactored return string * Refactored return string in js_ts_linter.py * Refactored code to make this clearer
Overview
Essential Checklist