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

Enable unnecessary-lambda Pylint check #1315

Merged
merged 2 commits into from
Feb 16, 2024

Conversation

lbianchi-lbl
Copy link
Contributor

Summary/Motivation:

  • unnecessary-lambda is a built-in Pylint check, that might help addressing some of the issues with lambdas described in Add Pylint Check for Lambda Functions #1240
  • However, this only looks as cases where my_func = lambda x, y: my_other_func(x, y), i.e where one could just simply set my_func = my_other_func
  • More to the point, it does nothing to detect and prevent other uses of lambda that cause most of the issues in Add Pylint Check for Lambda Functions #1240 (specifically, by definition, the closure scope gotchas only arise when the lambda has fewer arguments that the function being used)

Changes proposed in this PR:

  • Enable unnecessary-lambda Pylint check

Legal Acknowledgement

By contributing to this software project, I agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the license terms described in the LICENSE.txt file at the top level of this directory.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@ksbeattie ksbeattie added the Priority:Normal Normal Priority Issue or PR label Jan 11, 2024
Copy link

codecov bot commented Jan 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6decc12) 77.43% compared to head (916d2cb) 77.43%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1315      +/-   ##
==========================================
- Coverage   77.43%   77.43%   -0.01%     
==========================================
  Files         390      390              
  Lines       63758    63758              
  Branches    11737    11737              
==========================================
- Hits        49373    49370       -3     
- Misses      11841    11845       +4     
+ Partials     2544     2543       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lbianchi-lbl lbianchi-lbl self-assigned this Jan 18, 2024
Copy link
Member

@ksbeattie ksbeattie left a comment

Choose a reason for hiding this comment

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

LGTM

@lbianchi-lbl lbianchi-lbl marked this pull request as ready for review February 16, 2024 00:30
@lbianchi-lbl lbianchi-lbl added the CI:run-integration triggers_workflow: Integration label Feb 16, 2024
@idaes-build idaes-build removed the CI:run-integration triggers_workflow: Integration label Feb 16, 2024
@lbianchi-lbl lbianchi-lbl merged commit 063371a into IDAES:main Feb 16, 2024
59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:Normal Normal Priority Issue or PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants