Skip to content

Lint2#1061

Merged
dumbunny merged 5 commits intovitessio:masterfrom
dumbunny:lint2
Aug 31, 2015
Merged

Lint2#1061
dumbunny merged 5 commits intovitessio:masterfrom
dumbunny:lint2

Conversation

@dumbunny
Copy link
Contributor

Fix python lint errors: first pass for subdirectories of test, second pass for others.

This is the first pass for some subdirectories.

Recurring issues include:

1. Inconsistent quote chars. Use the same quote character as the first
use in the file (usually single-quote). Double quotes are OK if the
quoted string contains single quotes.

2. Bad indentation. Indent 2 for logic, 4 for continuations if the
previous line ends with '(', '[', or '{'. If drop does not immediately
follow the group-symbol, align with the opening group-symbol. I suggest
immediate drops, since these are stable if the content of the first
line changes, while aligning with the opening group-symbol requires
shifting the continuation lines.

3. Bad docstrings. A full docstring looks like:

   """Initial line ending with punctuation.

   Optional text.

   Args:
     Arg1: Description.
     Arg2: Description with
         indented continuation.

   Returns:
     Return text.

   Raises:
     ErrorClass: Description.
   """

4. Vertical spacing. Exactly two blank lines before top-level classes
or functions. Exactly one blank line before non-top-level classes or
functions. No more than one blank line within top-level constructs.
@dumbunny
Copy link
Contributor Author

@michael-berlin I think this is the last, broad python lint-oriented change I want to do. After this, we should make python linter available to keep commits compliant with our python coding style.

@aaijazi
Copy link
Contributor

aaijazi commented Aug 31, 2015

LGTM

Just spot checked a bunch of random places, this looks awesome, thanks for doing it!

@michael-berlin
Copy link
Contributor

LGTM

I also went over it.

Yes, I agree. We must lint the code at precommit then.

dumbunny added a commit that referenced this pull request Aug 31, 2015
@dumbunny dumbunny merged commit efa3b2c into vitessio:master Aug 31, 2015
notfelineit pushed a commit to planetscale/vitess that referenced this pull request Sep 21, 2022
…itessio#1061)

* refactor: make recovery Function code as the identifier of a function code and use it for finding if their is an actionable recovery and the recovery function

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: remvoe a TODO in checkIfAlreadyFixed by sending the cluster name when getting replication analysis

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: refactor refersh code logic to only refresh required information instead of the big-hammer approach of refreshing everything

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: add logs and refresh for analyzed instance after a recovery

Signed-off-by: Manan Gupta <manan@planetscale.com>

* refactor: fix typing error in comments

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: use context.Background() instead of nil

Signed-off-by: Manan Gupta <manan@planetscale.com>

* test: add testing for refreshTabletsInKeyspaceShard

Signed-off-by: Manan Gupta <manan@planetscale.com>

* test: add tests for shardPrimary function and also fix its implementation

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: address review comments

Signed-off-by: Manan Gupta <manan@planetscale.com>

* test: use cmp with proto.Equal

Signed-off-by: Manan Gupta <manan@planetscale.com>

Signed-off-by: Manan Gupta <manan@planetscale.com>

Signed-off-by: Manan Gupta <manan@planetscale.com>
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.

3 participants