-
Notifications
You must be signed in to change notification settings - Fork 12
duplicate-code triggering on type hints #25
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
Comments
@tekktrik Disable it in .pylintrc |
Will that disable it for whole library? My understanding was that we wanted to keep it working to prevent actual duplicate code, but ignore the try block imports use for type hints, but I'm new to .pylintrc so if there's a way to do that that sounds great. |
Alternatively, would it help to increase the lines of similarity required up from 4? Not really sure that's a solution so much as potentially decreasing the frequency of this issue. But maybe a small bump up to like 6 would be enough. |
Is this still an issue? I just submitted a PR and didn't run into this myself. |
It's currently disabled in the |
I wanted issues created for libraries that had actual duplicate code issues because the eventual idea is that they should be refactored to not fail duplicate code. However, that was not meant to be part of the adding type hints project, so I did not expect Tekktrik to complete a refactor. I did not want it disabled in |
Sounds good. I was just checking to make sure this wasn't supposed to be closed. |
I think this is resolved because all the libraries including this one got bumped up to 12 lines. |
Or is this worth still considering refactoring? |
I think it's worth leaving this issue open since it was failing on the code itself before typing was added. If someone wants to look into refactoring this somehow, it might be worth it. |
Looks like with the increase to 12 lines of similarity, and the fact that the original flag for duplicate code was on type annotations, this actually may be good to close. I re-ran |
Ok, thanks! Closing for now. |
Uh oh!
There was an error while loading. Please reload this page.
Pylint is triggering a failure for
duplicate-code
on the imports required for type hints. In this case, it triggers on the try-import-except block used to import modules needed only for typing but not operation.Per conversation, we should look into a way to get avoiding this kind of pylint failure for duplicate code without having to disable it entirely in
pre-commit-config.yaml
Current failure when
duplicate-code
is removed:The text was updated successfully, but these errors were encountered: