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

[pylint] Implement import-outside-toplevel (C0415) #8298

Closed

Conversation

dankleeman
Copy link

Summary

Per #970 :
Implement pylint rule C0415: import-outside-toplevel

https://pylint.readthedocs.io/en/latest/user_guide/messages/convention/import-outside-toplevel.html

Test Plan

With cargo test following the contribution instructions.

@github-actions
Copy link
Contributor

PR Check Results

Ecosystem

ℹ️ ecosystem check detected linter changes. (+1 -0 violations, +0 -0 fixes in 41 projects)

rotki/rotki (+1 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero

+ tools/pyinstaller_hooks/pre_find_module_path/hook-distutils.py:40:5: PLC0415 Import outside toplevel (opcode)

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
PLC0415 1 1 0 0 0

@charliermarsh charliermarsh self-requested a review October 28, 2023 22:44
@charliermarsh charliermarsh added the rule Implementing or modifying a lint rule label Oct 28, 2023
@charliermarsh
Copy link
Member

Ugh, so sorry -- thank you for getting involved but unfortunately there's already an open PR for this rule, which I've just been slow to merge (#5180). Is there any way I can help you pick out another rule to work on?

@dankleeman
Copy link
Author

Ugh, so sorry -- thank you for getting involved but unfortunately there's already an open PR for this rule, which I've just been slow to merge (#5180). Is there any way I can help you pick out another rule to work on?

No worries! I'd love to work on other rules. I'd happily take a shot at any rule you'd suggest.

I think my only concern picking another one on my own is the discussion on #970 that mentions not wanting to implement pylint rules that are covered by mypy: #970 (comment)

@charliermarsh
Copy link
Member

Awesome! Here are a few that look reasonable to me:

  • bad-staticmethod-argument
  • unnecessary-dunder-call
  • too-many-locals

Separately: @zanieb was actually planning to go through and move all the Mypy-overlapping rules to a separate section to avoid this issue in the future.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants