Skip to content

Format python with black#280

Merged
ralphbean merged 2 commits intomainfrom
black
Jan 24, 2025
Merged

Format python with black#280
ralphbean merged 2 commits intomainfrom
black

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.

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.

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.]

@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