Closed cjerdonek closed 7 years ago
I see this on single-item imports which are nevertheless too long for a single line, even without aliases. I set mutliline to 5 in setup.cfg but still get complaints about this import as follows:
--- /home/travis/build/jcb91/jupyter_contrib_nbextensions/src/jupyter_contrib_nbextensions/install.py:before 2016-12-28 13:18:28.647867
+++ /home/travis/build/jcb91/jupyter_contrib_nbextensions/src/jupyter_contrib_nbextensions/install.py:after 2016-12-28 13:19:50.188283
@@ -12,9 +12,8 @@
import latex_envs
import psutil
from jupyter_contrib_core.notebook_compat import nbextensions
-from jupyter_nbextensions_configurator.application import (
- EnableJupyterNbextensionsConfiguratorApp,
-)
+from jupyter_nbextensions_configurator.application import \
+ EnableJupyterNbextensionsConfiguratorApp
from traitlets.config import Config
from traitlets.config.manager import BaseJSONConfigManager
(see https://travis-ci.org/jcb91/jupyter_contrib_nbextensions/jobs/187200090#L417-L429 for actual logs of isort call)
Closing as this is now resolved in develop and will make it into the next release.
Thanks!
~Timothy
For others stumbling across this issue, it took me a while to realise that this is resolved _by using the use_parentheses
_ config option. Setting multi_line_output=5
is not sufficient on its own.
When
multi_line_output
is set to 5 (which should result in parentheses),isort
can still introduce backslashes. This can be seen in the Django project, for example, which sets it to 5 and yet still has the following: