Skip to content

Conversation

@WnP
Copy link

@WnP WnP commented Sep 3, 2018

No description provided.

import mechanicalsoup
from fake_useragent import UserAgent

import mechanicalsoup
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't must add a line break between fake_useragent and mechanicalsoup import.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO and from isort point of view module import import <module> should be separate from sub-module import from <module> import <sub-module> by a line break, that's why this line break is added

import logging

from mechanicalsoup.browser import LinkNotFoundError

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't must remove the line break here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that current module import should be separate with by a line break from other module import, to do so and keep isort usage better explicit define current module import as local using dot syntax, in this example:

from .context_manager import login

@WnP
Copy link
Author

WnP commented Sep 5, 2018

Here is my ~/.isort.cfg

[isort]
sections=FUTURE,STDLIB,THIRDPARTY,DJANGO,TAIGA,WAGTAIL,ODOO,ODOOADDONS,OPENERP,OPENERPADDONS,LOCALFOLDER,UNKNOWNTHIRDPARTY
known_odoo=odoo
known_odooaddons=odoo.addons
known_openerp=openerp
known_openerpaddons=openerp.addons
known_django=django
known_taiga=taiga
known_wagtail=wagtail
default_section=UNKNOWNTHIRDPARTY
multi_line_output=3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants