File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -139,3 +139,32 @@ results change for the worse. (This is done in memory. The actual files are
139139left untouched.)::
140140
141141 $ ./test_fuzz.py --verbose
142+
143+
144+ Excluding specific lines
145+ ========================
146+
147+ It might be the case that you have some imports for their side effects, even
148+ if you are not using them directly in that file.
149+
150+ That is common, for example, in Flask based applications. In where you import
151+ Python modules (files) that imported a main ``app ``, to have them included in
152+ the routes.
153+
154+ For example:
155+
156+ .. code-block :: python
157+
158+ from .endpoints import role, token, user, utils
159+
160+ As those imports are not being used directly, if you are using the option
161+ ``--remove-all-unused-imports ``, they would be removed.
162+
163+ To prevent that, without having to exclude the entire file, you can add a
164+ ``# noqa `` comment at the end of the line, like:
165+
166+ .. code-block :: python
167+
168+ from .endpoints import role, token, user, utils # noqa
169+
170+ That line will instruct ``autoflake `` to let that specific line as is.
You can’t perform that action at this time.
0 commit comments