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

SONARPY-2385 Add test for S5756 about uncallable lambda #2215

Merged
merged 2 commits into from
Dec 6, 2024

Conversation

thomas-serre-sonarsource
Copy link
Contributor

@thomas-serre-sonarsource thomas-serre-sonarsource commented Dec 4, 2024

Copy link
Contributor

@maksim-grebeniuk-sonarsource maksim-grebeniuk-sonarsource left a comment

Choose a reason for hiding this comment

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

LGTM, probably it makes sense to also add a test case with another parenthesis configuration:

def foo():
  return "hello"

x = (lambda : foo())() # here is ok cause it is a lambda call
print(x)

Copy link
Contributor

Choose a reason for hiding this comment

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

need to discuss the naming and probably add more test cases

@@ -407,3 +407,6 @@ def function_type_is_callable():
def object_typevar():
scheduled = []
scheduled.pop()() # OK

def uncallable_lambda_are_non_compliant():

Choose a reason for hiding this comment

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

rename to non-callable inside lamda

Copy link

sonarqube-next bot commented Dec 5, 2024

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM

@thomas-serre-sonarsource thomas-serre-sonarsource merged commit 4d80324 into master Dec 6, 2024
12 checks passed
@thomas-serre-sonarsource thomas-serre-sonarsource deleted the SONARPY-2385 branch December 6, 2024 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants