-
Notifications
You must be signed in to change notification settings - Fork 171
Black formatting preparation #3314
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
Conversation
Signed-off-by: Coady LaCroix <[email protected]>
Signed-off-by: Coady LaCroix <[email protected]>
ocs_ci/utility/gcp.py
Outdated
# cluster access as well. | ||
# | ||
# For more details, see `GCP documentation on ServiceAccountKey resource | ||
# <https://cloud.google.com/iam/docs/reference/rest/v1/projects.serviceAccounts.keys>`_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this change preserve this docstring in our sphinx build?
Right now, it's part of our documentation as expected: https://ocs-ci.readthedocs.io/en/latest/apidoc/ocs_ci.utility.html#ocs_ci.utility.gcp.SERVICE_ACCOUNT_KEY_FILEPATH
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, this I'm not sure of. Right now it's causing the following error in our check-docstring-first
hook:
Check docstring is first.................................................Failed
- hook id: check-docstring-first
- exit code: 1
ocs_ci/utility/gcp.py:29 Multiple module docstrings (first docstring on line 2).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can check the docs from this build and resolve it if it looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is actually an open issue for this pre-commit/pre-commit-hooks#159 with a potential fix that has yet to be merged. It may be worth reconsidering the use of check-docstring-first
until that is fixed if we want to use attribute docstrings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, looks like there may be a workaround for this: pre-commit/pre-commit-hooks#159 (comment). I'll try to test this out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bug in check-docstring-first
, likely pre-commit/pre-commit-hooks#159 - as you can see in the html sphinx build, both module docstring and variable docstring are present as expected.
I suggest to disable this particular hook.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I have tried to use the #:
syntax workaround but it doesn't seem to work for me. I'm not seeing any attribute doc unless I go with the triple quote docstring method.
I suggest to disable this particular hook.
I agree, I am going to revert the change to this docstring and disable the check entirely.
c37179c
to
6dca5ab
Compare
Signed-off-by: Coady LaCroix <[email protected]>
…ng sphinx attribute docstrings Signed-off-by: Coady LaCroix <[email protected]>
6dca5ab
to
dcaac05
Compare
@vasukulkarni @mbukatov I have reverted the change to that particular docstring and removed |
* Flake8 ignore E203 * Fix flake8 issues * Fix check-docstring-first failures * Remove check-docstring-first pre-commit hook as it doesnt support using sphinx attribute docstrings Signed-off-by: Coady LaCroix <[email protected]>
This PR fixes various issues that were causing pre-commit to fail after formatting the repo with black. These failures were coming up now because pre-commit runs against files in your changeset and not against the entire repository. These problems existed before black formatting was being done.