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

Format python with black #280

Merged
merged 2 commits into from
Jan 24, 2025
Merged

Format python with black #280

merged 2 commits into from
Jan 24, 2025

Conversation

ralphbean
Copy link
Member

Just for consistent style.

@ralphbean ralphbean requested a review from Zyzyx as a code owner January 24, 2025 15:00
@ralphbean
Copy link
Member Author

This includes changes from #279.

webbnh
webbnh previously approved these changes Jan 24, 2025
Copy link
Collaborator

@webbnh webbnh left a comment

Choose a reason for hiding this comment

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

I'm a fan of using Black, even if I don't necessarily like everything that it does.

I've called out a few things below:

  • Foremost, it looks like you included a commit on this branch which belongs in a separate PR.
  • Beyond that, there are a couple of changes that Black made that I think you might want to resist in various ways.
  • And, finally, the changes highlighted a couple of spots in the code where we might want to make some tweaks beyond what Black proposed...which you should feel free to decline.

docs/source/conf.py Outdated Show resolved Hide resolved
sync2jira/main.py Outdated Show resolved Hide resolved
tox.ini Outdated Show resolved Hide resolved
Comment on lines 415 to 420
filter(
lambda x: _find_comment_in_jira(x, j_comments) is None or x['changed'] is not None,
g_comments
)
lambda x: _find_comment_in_jira(x, j_comments) is None
or x["changed"] is not None,
g_comments,
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

[I don't know whether you're interested in making this sort of change, but I'll point it out and you can decline if you like....]

Since we're going to include x in the result if it is changed, we should check that before checking to see if the comment is in j_comments.

sync2jira/downstream_issue.py Outdated Show resolved Hide resolved
sync2jira/main.py Outdated Show resolved Hide resolved
Comment on lines +151 to +159
return jira.client.JIRA(
**{
"options": {
"server": URL,
"verify": False,
},
"token_auth": TOKEN,
}
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Using the ** operator on a literal is a little heavy-handed, we should do something like this, instead:

Suggested change
return jira.client.JIRA(
**{
"options": {
"server": URL,
"verify": False,
},
"token_auth": TOKEN,
}
)
return jira.client.JIRA(
options={
"server": URL,
"verify": False,
},
token_auth=TOKEN,
)

[Again, feel free to decline if you aren't interested in this kind of change in this PR.]

tests/test_intermediary.py Show resolved Hide resolved
@webbnh webbnh mentioned this pull request Jan 24, 2025
@ralphbean ralphbean merged commit 47decc4 into main Jan 24, 2025
5 checks passed
@ralphbean ralphbean deleted the black branch January 24, 2025 20:52
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