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

[V3] Code standards (black code format pass) #1650

Merged
merged 2 commits into from
May 14, 2018
Merged

[V3] Code standards (black code format pass) #1650

merged 2 commits into from
May 14, 2018

Conversation

mikeshardmind
Copy link
Contributor

Type

  • Bugfix
  • Enhancement
  • New feature

Description of the changes

ran black: code formatter against redbot/ with -l 99

resulting code should be functionally equivalent via ast comparison

This works towards #1636 and the discussed goals in discord

Copy link
Contributor

@bobloy bobloy left a comment

Choose a reason for hiding this comment

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

Doesn't seem consistent.

Additionally, won't this likely cause unnecessary merge conflicts?


@announce.command(name="ignore")
@commands.guild_only()
@checks.guildowner_or_permissions(administrator=True)
async def announce_ignore(self, ctx, *, guild: discord.Guild=None):
async def announce_ignore(self, ctx, *, guild: discord.Guild = None):
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does it add spaces around the = operator here and not below?

message: str,
config=None):

def __init__(self, ctx: commands.Context, message: str, config=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

Here it does not add spaces around the = operator, despite doing it above frequently

Copy link
Member

Choose a reason for hiding this comment

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

One of them has a type annotation and the other does not. It's consistent and compliant.


self.conf.register_guild(
announce_ignore=False,
announce_channel=None, # Integer ID
selfroles=[] # List of integer ID's
selfroles=[], # List of integer ID's
Copy link
Member

Choose a reason for hiding this comment

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

Where did this even come from. Is that compliant?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, it's compliant and a style choice.

tekulvw
tekulvw previously approved these changes May 14, 2018
@tekulvw tekulvw merged commit b88b5a2 into Cog-Creators:V3/develop May 14, 2018
@mikeshardmind mikeshardmind deleted the V3/code-style-black branch December 26, 2019 16:55
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