Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
CI: Added isort import check for the code on pull-request #4242
CI: Added isort import check for the code on pull-request #4242
Changes from all commits
4d271f9
7ec72d3
6852819
54f3aa5
91e2b81
b07f8fc
f5f9d1c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Borda would we want use black style for sorting or other? There is also pycharm style https://pycqa.github.io/isort/docs/configuration/profiles/
Hi @nathanpainchaud which profile do you think is suitable for lightning which follows pep8 for code formatting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we get some examples?
for me split to three sections: build-in, third-party and locals
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is with black profile using command as this PR
with pycharm profile
with google profile
no profile
All of them split built-in, third-party, locals
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ydcjeff already gave a good explanation. What I can add to this is that since PL has already decided to use
black
for formatting the code, I would heavily suggest using theblack
profile. Otherwise, we might fall into a "deadlock" between checks, whereisort
andblack
suggest conflicting changes (speaking from experience there 😛) Using theblack
profile guarantees that both tools won't conflict with each other.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think PL isn't using
black
cc: @Borda
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not back for codebase just for formating imports
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, my bad! I saw the pre-commit hook for
black
and I thought it was already in use. In that case, it's a bit up to personal preference, and what we want to prioritize.I like the black format myself, but for a community project like PL I think a profile with single line imports (like
google
andopen_stack
) might prevent some conflicts in the imports.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 from me on
black
with consistent string formatting too. makes my OCD go crazy when i see some variables with single quotes and others with double quotes in the same file :)