-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
[Python] Improve Python consistency: Use function_name(…) throughout (PEP8) #1399
[Python] Improve Python consistency: Use function_name(…) throughout (PEP8) #1399
Conversation
@swift-ci Please test |
Awesome! What's left before we can activate the |
@@ -21,4 +21,4 @@ | |||
Bindings for the sourcekitd framework. | |||
""" | |||
|
|||
__all__ = ['capi', 'request'] | |||
__all__ = ('capi', 'request') |
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.
All of these transformations to __all__
are probably incorrect, no? As far as I know, __all__
is a list, not a tuple.
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.
Did your search and replace misfire?
This looks great, aside from the changes to |
@modocache Thanks for reviewing! :-) The When thinking of it the Thanks for noticing! |
@gribozavr Merge conflicts have now been resolved :-) |
@gribozavr + @nadavrot Another round of newly introduced merge conflicts resolved :-) Let me know if any changes are needed for this PR to be merged. |
@modocache Regarding your question about the |
@swift-ci Please test |
@gottesmm Both builds passed. Are there any further changes needed for this PR to be merged? :-) |
@practicalswift Out of curiosity, how did you generate the changes? Were you using something like rope? |
@practicalswift The reason why I am asking is I want to know if I should lint the code while reviewing since some of this code is not invoked by the normal build. |
@gottesmm All changes were made manually using I also used |
Another newly introduced merge conflict now resolved :-) |
@gottesmm This oneliner can be used to list the old names of the renamed functions:
|
And this to search for occurrences of the old names of the functions to make sure there are no remaining references to them in the repo:
|
Ok. I am going to just run it through pylint and then I will merge assuming nothing comes up. |
@gottesmm Excellent! 👍 Thanks! |
pylint -E was not clean, but none of it was due to this commit. This commit LGTM. |
[Python] Improve Python consistency: Use function_name(…) throughout (PEP8)
Use fatal_error instead of diagnostics in build-script
Background: See discussion with @modocache and @nadavrot in #1369. This is a follow-up to #1374.
The majority of Python function names in the repo are in lowercase with words separated by underscores (
snake_case_function
). This is also the form recommended by the PEP8 function naming recommendations (Python Software Foundation).This PR improves consistency by converting the remaning cases of
camelCaseFunction
to the PEP-8 form (snake_case_function
) used by convention in the repo.@modocache - do you have time to review? That would be really appreciated :-)