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

dev-tools: fix pylint in cherrypick_pr #3770

Merged
merged 3 commits into from
Mar 24, 2017
Merged

dev-tools: fix pylint in cherrypick_pr #3770

merged 3 commits into from
Mar 24, 2017

Conversation

7AC
Copy link
Contributor

@7AC 7AC commented Mar 17, 2017

No description provided.

@7AC 7AC added the review label Mar 17, 2017
@@ -77,10 +79,10 @@ def main():
check_call("git checkout -b {}".format(tmp_branch), shell=True)
if call("git cherry-pick -x {}".format(" ".join(args.commit_hashes)),
shell=True) != 0:
print("Looks like you have cherry-pick errors.")
Copy link
Member

Choose a reason for hiding this comment

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

This change will break compatibilty with python 3.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! Do you prefer using __future__ or ignoring the warning? https://docs.python.org/3.5/library/__future__.html

Copy link
Contributor Author

@7AC 7AC Mar 20, 2017

Choose a reason for hiding this comment

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

I just switched to python3 and restored the parentheses, also renamed raw_input() to input()

Copy link
Member

@ruflin ruflin left a comment

Choose a reason for hiding this comment

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

This probably also ties into the PR #3763. See my comment here: #3763 (comment)

@@ -106,36 +108,35 @@ def main():
else:
token = open(expanduser("~/.github_token"), "r").read().strip()
base = "https://api.github.com/repos/elastic/beats"
s = requests.Session()
s.headers.update({"Authorization": "token " + token})
session = requests.Session()
Copy link
Member

Choose a reason for hiding this comment

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

+1 on having more descriptive variable names

@7AC
Copy link
Contributor Author

7AC commented Mar 21, 2017

Removed the pylint: ignore statement and added it to .pylintrc in #3763 to avoid conflicts

@@ -94,7 +96,7 @@ def main():
return 1

print("Ready to push branch.")
remote = raw_input("To which remote should I push? (your fork): ")
remote = input("To which remote should I push? (your fork): ")
Copy link
Member

Choose a reason for hiding this comment

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

Will input instead of raw_input work in python 2.7?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, that's a risky one I'll revert it.

s.post(base+"/issues/{}/labels".format(new_pr["number"]),
json=["backport", "review"])
session.post(
base + "/issues/{}/labels".format(new_pr["number"]), json=["backport", "review"])
Copy link
Contributor

Choose a reason for hiding this comment

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

We probably have different settings in the editor, because this version yields an pep error here for me (line too long (93 > 79 characters)). I think I am just using the default pep settings.

We didn't yet impose pep/flake in the CI so far because they can be annoying sometimes and the python code that we have is generally not mission critical. Perhaps it's worth discussing this again.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We pass it --max-line-length 120 in the check target, I'll adjust my settings to that. Thanks

@ruflin ruflin merged commit 0d85e09 into elastic:master Mar 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants