-
-
Notifications
You must be signed in to change notification settings - Fork 596
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
Feature Request: Footer Section #1733
Comments
I like this idea! And would happily merge in a PR that adds support - or circle back and complete it for a future version. Thanks for submitting the improvement ticket! |
Great. My personal life is busy at the moment, but if you don't get around to it soon, I'll submit a PR when I can find some time |
@timothycrosley can we get a new point release so that this (and any other new features) can be available via PyPI? (I thought I already commented this, but I don't see it so maybe I forgot to hit comment) Oops, I see I made it on the PR itself now, sorry for the double message |
There is already a feature to add import headings at the start of a section. Can we also add a footer at the end of the section? My use case is where I've made a custom section for some libraries that are not available in the development environment and so I want to surround those imports with disable and enable tags to silence
pylint
.Currently I just use the enable comment as the heading for the next section, but this is fragile as there are times where that section doesn't exist and thus the imports are disabled for the entire rest of the file.
As a quick example of what I'd like to have:
Note that I've added a blank line before the line
# pylint: enable=import-error
for compatibility withblack
which doesn't allow a comment on a line directly after an import.I realize that I could just use
import library_not_available_in_dev # pylint: disable=import-error
on a single line instead, but in my actual application I have many of these libraries that are not available and thus it is cleaner/preferable to surround that block of imports with disable/enable tags as I've shown.The text was updated successfully, but these errors were encountered: