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

Comply with PEP8 #6

Closed
0xjac opened this issue Jun 23, 2017 · 0 comments
Closed

Comply with PEP8 #6

0xjac opened this issue Jun 23, 2017 · 0 comments

Comments

@0xjac
Copy link

0xjac commented Jun 23, 2017

The code has multiple PEP8 violations to be fixed, including but not limited to:

  • two blank lines before a class declaration (L12, L17, L25, L31, L35)

  • class name should use CamelCase (L12, L17, L25, L31, L35)

  • use new style classes: class ClassName(object): (L35)

  • 2 spaces before comment: # (L44 and more)

  • block comment should start with a pound and a space after it (L48, L91, L199, L204, L315)

  • missing space after , (L98, L220, L230 and more)

  • redundant parenthesis (L220, L224, L227, L230)

  • missing spaces around operators: 3*x -> 3 * x, self.actions+="y" -> self.actions += 'y'

I'm also leaving here a couple other minor issues which are not exactly PEP8:

  • use .format instead of % for string formatting.

  • cannot return value from init (L52, L66, L72, L95, L101)

    If you need a catastrophic failure here, raise an exception, preferably a custom one for clarity.

  • use setup_req.UnitType in {0x06, 0x07} instead of or L90

    Using set membership will make your condition shorter and more readable, esp. if you need to add another value
    later on.

  • In my opinion I would remove the t1 variable or if you want to keep it, use a clearer name such as loop_thread (L102)

  • variable ACTION_SIZE should be lowercase. (L116)

    This is irrelevant once Use an actions queue instead of a string #3 is fixed

@Minege Minege closed this as completed in d9dd226 Jul 5, 2017
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

No branches or pull requests

1 participant