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

lint with yapf and isort #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

lint with yapf and isort #1

wants to merge 2 commits into from

Conversation

WnP
Copy link

@WnP WnP commented Sep 3, 2018

No description provided.

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

@@ -3,10 +3,8 @@
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