FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Updates for pycodestyle. by daspecster · Pull Request #2973 · googleapis/google-cloud-python · GitHub

Updates for pycodestyle. - #2973

Merged
daspecster merged 6 commits into
googleapis:masterfrom
daspecster:fix-new-lint-issues
Jan 31, 2017
Merged

Updates for pycodestyle.#2973
daspecster merged 6 commits into
googleapis:masterfrom
daspecster:fix-new-lint-issues

Conversation

daspecster commented Jan 30, 2017
edited
Loading

Copy link
Copy Markdown
Contributor

These changes allow pycodestyle to pass.

Closes #2974

googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jan 30, 2017
Comment thread bigquery/unit_tests/test_dataset.py Outdated
try:
response, self._responses = self._responses[0], self._responses[1:]
except:
except Exception:

This comment was marked as spam.

Comment thread core/unit_tests/test__helpers.py Outdated
return _determine_default_project(project=project)

def test_it(self):

This comment was marked as spam.

Comment thread core/unit_tests/test__helpers.py Outdated
project = self._call_fut()

self.assertEqual(project, mock.sentinel.project)

This comment was marked as spam.

dhermes commented Jan 30, 2017

Copy link
Copy Markdown
Contributor

Are the whitespace changes actually required by the tool, or did you just add them because they seemed needed? I know of no justification in PEP8 etc. for them.

Jinx, bigly

Copy link
Copy Markdown
Contributor Author

@tseaver I'm wondering if it's a bug in pycodestyle. I moved them around a little bit to try and see what it was looking for and that was the way it had to be to pass. We could probably disable that error.

dhermes commented Jan 30, 2017

Copy link
Copy Markdown
Contributor

@daspecster Please provide the errors so we can try to help

daspecster commented Jan 30, 2017
edited
Loading

Copy link
Copy Markdown
Contributor Author

There were only two types of errors. One was the bare except and this was the other one.

core/unit_tests/test__helpers.py:147:9: E306 expected 1 blank line before a nested definition, found 0
core/unit_tests/test_credentials.py:34:9: E306 expected 1 blank line before a nested definition, found 0
datastore/unit_tests/test_client.py:159:9: E306 expected 1 blank line before a nested definition, found 0
datastore/unit_tests/test_client.py:518:9: E306 expected 1 blank line before a nested definition, found 0

tseaver commented Jan 30, 2017

Copy link
Copy Markdown
Contributor

I vote to suppress that error with prejudice.

dhermes commented Jan 30, 2017

Copy link
Copy Markdown
Contributor

I'd agree, we should suppress, but not before filing an issue with the pycodestyle folks

Copy link
Copy Markdown
Contributor Author

SGTM, I'll update and I can file the issue on pycodestyle as well.

Copy link
Copy Markdown
Contributor Author

There's a bare except in transaction.py that I'm not sure what the possible exception types could be. I think it could be a few things. If there is a known exception type for this then I can stop ignoring E306.

dhermes commented Jan 30, 2017

Copy link
Copy Markdown
Contributor

The except in transaction.py is meant to be bare (it's somewhat of a special case). You can locally disable pycodestyle checks via noqa (e.g.)

self._id = self._client._connection.begin_transaction(
self.project)
except:
except: # noqa: E722

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Comment thread scripts/pycodestyle_on_repo.py Outdated
else:
pycodestyle_command = ['pycodestyle'] + python_files
pycodestyle_command = ['pycodestyle',
'--ignore=E306,E123'] + python_files

This comment was marked as spam.

dhermes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM if CI goes green

self._id = self._client._connection.begin_transaction(
self.project)
except:
except: # noqa: E722 do not use bare except, specify exception instead

This comment was marked as spam.

This comment was marked as spam.

daspecster merged commit ed0698f into googleapis:master Jan 31, 2017
daspecster deleted the fix-new-lint-issues branch January 31, 2017 14:17

Copy link
Copy Markdown
Contributor

The except in transaction.py is meant to be bare (it's somewhat of a special case). You can locally disable pycodestyle checks via noqa (e.g.)

Or except Exception, if it passes the linter.

dhermes commented Jan 31, 2017

Copy link
Copy Markdown
Contributor

@lukesneeringer I am allergic to except Exception and that misses nasty exception types that only inherit from BaseException and pylint will complain about Exception being too broad

Copy link
Copy Markdown
Contributor

Fair on all counts. :-)

richkadel pushed a commit to richkadel/google-cloud-python that referenced this pull request May 6, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL