Skip to content

[Python] Improve Python consistency: "variable in function should be lowercase" (N806) #1512

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

Merged
merged 1 commit into from
Mar 2, 2016
Merged

[Python] Improve Python consistency: "variable in function should be lowercase" (N806) #1512

merged 1 commit into from
Mar 2, 2016

Conversation

practicalswift
Copy link
Contributor

What's in this pull request?

Background

See discussion with @modocache and @nadavrot in #1369.

This is PR is part 3 of 3 in the series of PRs covering the Python naming consistency fixes discussed in #1369.

The previous parts were:

Rationale

The repo contains roughly 80 Python scripts. snake_case naming is used for local variables in all those scripts. This is the form recommended by the PEP 8 naming recommendations (Python Software Foundation) and typically associated with idiomatic Python code.

However, in 11 of the 80 scripts there were at least one instance of camelCase naming prior to this commit.

This commit improves consistency in the Python code base by making sure that these eleven remaining files also follow the variable naming convention used for Python code in the project.

References

Resolved bug number: –


Before merging this pull request to apple/swift repository:

  • Test pull request on Swift continuous integration.

Triggering Swift CI

The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:

Smoke Testing

Platform Comment
All supported platforms @swift-ci Please smoke test
OS X platform @swift-ci Please smoke test OS X platform
Linux platform @swift-ci Please smoke test Linux platform

Validation Testing

Platform Comment
All supported platforms @swift-ci Please test
OS X platform @swift-ci Please test OS X platform
Linux platform @swift-ci Please test Linux platform

Note: Only members of the Apple organization can trigger swift-ci.

…lowercase" (N806)

The repo contains roughly 80 Python scripts. "snake_case" naming is used for
local variables in all those scripts. This is the form recommended by the PEP 8
naming recommendations (Python Software Foundation) and typically associated
with idiomatic Python code.

However, in nine of the 80 scripts there were at least one instance of
"camelCase" naming prior to this commit.

This commit improves consistency in the Python code base by making sure that
these nine remaining files follow the variable naming convention used for
Python code in the project.

References:
* PEP 8: https://www.python.org/dev/peps/pep-0008/
* pep8-naming: https://pypi.python.org/pypi/pep8-naming
@practicalswift
Copy link
Contributor Author

@modocache Do you have time to review? That would be appreciated! :-)

@modocache
Copy link
Contributor

Looks good to me, based on a quick scan through the source files. I'd merge this if CI passes! 💯

@modocache
Copy link
Contributor

@swift-ci please test

@practicalswift
Copy link
Contributor Author

@modocache Thanks! Unfortunately I don't think commit access is a sufficient condition for being able to trigger @swift-ci :-) Seems like these commands can only be issued by Apple employees at the moment.

@trentxintong
Copy link
Contributor

@swift-ci Please test

@modocache
Copy link
Contributor

@practicalswift Yeah, I type in "@swift-ci please test" as a sort of bat signal for Apple org members to trigger CI for me. 😂 Thanks, @trentxintong!

@jckarter
Copy link
Contributor

jckarter commented Mar 2, 2016

@jckarter please swift-ci

modocache added a commit that referenced this pull request Mar 2, 2016
[Python] Improve Python consistency: "variable in function should be lowercase" (N806)
@modocache modocache merged commit 5bc2749 into swiftlang:master Mar 2, 2016
@modocache
Copy link
Contributor

Thanks, @practicalswift! 💯

(Aside: I wish more of the Python code in utils was tested as part of the validation tests, like utils/swift_build_support is.)

MaxDesiatov added a commit that referenced this pull request Oct 19, 2020
Fix run filtering in nightly distribution script
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.

4 participants