Skip to content
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

Add implicit-str-concat & inconsistent-return-statements check #3882

Merged
merged 2 commits into from Apr 20, 2023
Merged

Conversation

Ruchip16
Copy link
Member

The implicit-str-concat rule ensures that the string concatenation is done implicitly in an assignment statement using an explicit operator, such as + or other methods like string-formatting, etc. This can improve code readability and reduce the likelihood of introducing errors related to string concatenation.

The inconsistent-return-statements rule raises an error when a function has multiple return statements, and some of them return an expression while others do not. This can lead to unexpected behavior and make the code harder to understand. The check ensures that the function has consistent return statements and that it always returns an expression or none of them return an expression, making the code more predictable and easier to understand.

@Ruchip16 Ruchip16 added the bug label Apr 20, 2023
@Ruchip16 Ruchip16 self-assigned this Apr 20, 2023
@Ruchip16 Ruchip16 requested review from a team as code owners April 20, 2023 12:58
@Ruchip16 Ruchip16 requested review from ziegenberg, apatard, ssbarnea, ganeshrn and trishnaguha and removed request for a team April 20, 2023 12:58
@Ruchip16 Ruchip16 enabled auto-merge (squash) April 20, 2023 13:05
@@ -947,7 +947,7 @@ def _verify_inventory(self):
:return: None
"""
if not self.inventory:
msg = "Instances missing from the 'platform' " "section of molecule.yml."
msg = "Instances missing from the 'platform' " + "section of molecule.yml."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ruchip16 why do we need a concatenation here?
It can be a single string right?
Am I missing something?

Copy link
Member Author

@Ruchip16 Ruchip16 Apr 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeaa i thought they are two separate strings and hence I did not combine them into one but good point we can just make it a single string @ssbarnea shall we combine them into just one string?

@Ruchip16 Ruchip16 merged commit 58c6364 into main Apr 20, 2023
15 checks passed
@Ruchip16 Ruchip16 deleted the fixes branch April 20, 2023 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants