Skip to content

Added support for multiple fixes per block in fix-file-resouce-leak#245

Merged
andrecsilva merged 2 commits intomainfrom
multi-fresource-leak
Feb 13, 2024
Merged

Added support for multiple fixes per block in fix-file-resouce-leak#245
andrecsilva merged 2 commits intomainfrom
multi-fresource-leak

Conversation

@andrecsilva
Copy link
Copy Markdown
Contributor

Overview

fix-file-resource-leak will now fix multiple leaks in a single block at once

@andrecsilva andrecsilva marked this pull request as ready for review February 7, 2024 13:47
Comment thread src/core_codemods/file_resource_leak.py Outdated
)
# is closed?
name_condition = map(
# pylint: disable-next=cell-var-from-loop
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

hmmm either this pylint warning is worth listening to or it's a pylint bug? Either way, maybe a list-comp is easier to read here?

Copy link
Copy Markdown
Contributor Author

@andrecsilva andrecsilva Feb 8, 2024

Choose a reason for hiding this comment

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

I wanted to avoid building the list since the result would just be fed into all. I don't exactly remember the issue with the warning was. It may be invalid by now. I'll try to remove and see if it still complains.

Copy link
Copy Markdown
Contributor

@clavedeluna clavedeluna left a comment

Choose a reason for hiding this comment

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

Personal preference nit pick would be to use less one-letter variable names as it's harder to grep for them .

Comment thread src/core_codemods/file_resource_leak.py Outdated
results: list[Result],
file_context: FileContext,
*codemod_args,
*codemod_args, # pylint: disable=unused-argument
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Small thing but I think the idiomatic way to suppress this is with

del *codemod_args

Although possibly this argument is no longer needed?

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
1 New issue

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@andrecsilva andrecsilva added this pull request to the merge queue Feb 13, 2024
Merged via the queue into main with commit a9c2c67 Feb 13, 2024
@andrecsilva andrecsilva deleted the multi-fresource-leak branch February 13, 2024 12:07
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.

3 participants