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

New codemod to replace hasattr(obj, "__call__") with callable #329

Merged
merged 2 commits into from
Mar 6, 2024

Conversation

clavedeluna
Copy link
Contributor

@clavedeluna clavedeluna commented Mar 5, 2024

Overview

Using callable is the recommended and reliable way to check if something is a callable

Closes #290

@clavedeluna clavedeluna changed the title Hasattr call New codemod to replace hasattr(obj, "__call__") with callable Mar 5, 2024
@clavedeluna clavedeluna marked this pull request as ready for review March 5, 2024 12:48
Copy link
Member

@drdavella drdavella left a comment

Choose a reason for hiding this comment

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

Looks good, just a suggestion/request for changing the summary.

src/core_codemods/fix_hasattr_call.py Outdated Show resolved Hide resolved
@clavedeluna clavedeluna dismissed drdavella’s stale review March 6, 2024 11:33

impl small change, dismissing so I can add to merge queue

Copy link

sonarqubecloud bot commented Mar 6, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

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

See analysis details on SonarCloud

@clavedeluna clavedeluna added this pull request to the merge queue Mar 6, 2024
Merged via the queue into main with commit b211323 Mar 6, 2024
11 checks passed
@clavedeluna clavedeluna deleted the hasattr-call branch March 6, 2024 12:15
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.

Codemod to replace use of hasattr(obj, "__call__") with callable`
3 participants