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

Enforce multiple of 4 space indentation in docstring #8165

Closed
kevinlee12 opened this issue Dec 11, 2019 · 5 comments
Closed

Enforce multiple of 4 space indentation in docstring #8165

kevinlee12 opened this issue Dec 11, 2019 · 5 comments

Comments

@kevinlee12
Copy link
Contributor

From #8130 (comment), we should enforce 4 space indentation in docstring. Pylint doesn't support this natively, so the approach right now is to see if Code Climate has this check.

@kevinlee12
Copy link
Contributor Author

Filed in #8423

@kevjumba
Copy link
Contributor

@kevinlee12 I would like to attempt this, is this issue still open? I checked and it doesn't seem like the person on the issue right now is working on it.

@kevinlee12
Copy link
Contributor Author

go for it!

@kevjumba
Copy link
Contributor

@kevinlee12 can you give me some more specific details on what exactly you're looking for
Specifically, I have a docstring that is surrounded by """. Currently all of the docstrings have a syntax like this
"""Add AppStats recording.
This also sets the level of appstats log messages to 'debug' by
monkey-patching. For details, see:
https://stackoverflow.com/questions/4305243/disable-appstats-logging
"""
where the first line is inline with the first triple quote and each intermediary line is indented the same as the first triple quote. Is this the wrong syntax? What do I want this to look like?

@seanlip
Copy link
Member

seanlip commented Jun 17, 2020

See the comment linked in the first comment of this thread for an example: #8130 (comment)

Under "Args", "Raises", "Returns" sections, each new stanza should be indented by 4.

For each arg in "Args" and "Raises", continuation lines (if the description wraps to the next line) should be indented by 4. This is not needed for "Returns" because there's always only one thing in "Returns".

The part of the docstring you refer to doesn't need to be changed.

seanlip pushed a commit that referenced this issue Jun 29, 2020
…docstrings (#9654)

* Add tests to push coverage on StatesObjectFactory.ts to 100%

* Remove StatesObjectFactory from coverage

* Change fdescribe back to describe

* Fix linter issues

* Add outer if statement logic

* Add four/eight space indentation and tests

* Revert "Fix linter issues"

This reverts commit 540db31f8c4395a97718f858093967db2f6855d8.

* Revert "Change fdescribe back to describe"

This reverts commit 5c3d4997b5a27eb38f711c28ebc9fc0b56e6a2a0.

* Revert "Remove StatesObjectFactory from coverage"

This reverts commit 3a2d0614a04e535662e59ef38035329cd15068fc.

* Revert "Add tests to push coverage on StatesObjectFactory.ts to 100%"

This reverts commit fb68531b83c8247095d9d91afe1c4d25884e25ca.

* Fix linting and checks

* Change Return: to Returns: or else linter doesn't work

* Fix functionality and change up the requirements

* Make it possible to run file extensions on full path

* Fix some of the indentation issues caught by linter

* Add a new free form option and fix linting in exp_domain

* Fix linting in skill_services and prod_validation_jobs_one_off

* Fix linter in state_domain and stats_domain

* Fix smaller lint issues with rest of domain files

* Fix new lint issues

* Exp_domain linting fixes need some oversight

* Continue

* Add a new check for Args: docstring

* Revert "Exp_domain linting fixes need some oversight"

This reverts commit 1812e9d.

* Fix linting indentation in core/domain

* Fix lint issues in core/storage and core/platform

* Fix lint issues in rest of core

* Fix scripts linting

* Fix extensions linting

* Add misc linting

* Add new checks to pylint

* Readd all of the commented out checks

* fix fs domain

* Add tests

* Add comments

* Fix names and comments

* Final pass from look at github diff

* Fix more lint issues

* 2nd pass on PR

* Add tests for coverage

* Fix some more small indentation/description errors

* Address PR review comments

* Change the type to be more specific

* Address review comments

* Fix more list parameter definitions with no typeinfo

* Wrap the offending comment in jobs.py in a pylint-disable

* Address the review comments

* Accidentally removed a space when debugging that I added back in

* Address issues with PR

* Fix linting

* Fix more linting

* One more fix for syntax

* Increase coverage to 100% for backend tests and fix lint issue

* Fix lint issues from merge
shavavo pushed a commit to shavavo/oppia that referenced this issue Aug 20, 2020
… for docstrings (oppia#9654)

* Add tests to push coverage on StatesObjectFactory.ts to 100%

* Remove StatesObjectFactory from coverage

* Change fdescribe back to describe

* Fix linter issues

* Add outer if statement logic

* Add four/eight space indentation and tests

* Revert "Fix linter issues"

This reverts commit 540db31f8c4395a97718f858093967db2f6855d8.

* Revert "Change fdescribe back to describe"

This reverts commit 5c3d4997b5a27eb38f711c28ebc9fc0b56e6a2a0.

* Revert "Remove StatesObjectFactory from coverage"

This reverts commit 3a2d0614a04e535662e59ef38035329cd15068fc.

* Revert "Add tests to push coverage on StatesObjectFactory.ts to 100%"

This reverts commit fb68531b83c8247095d9d91afe1c4d25884e25ca.

* Fix linting and checks

* Change Return: to Returns: or else linter doesn't work

* Fix functionality and change up the requirements

* Make it possible to run file extensions on full path

* Fix some of the indentation issues caught by linter

* Add a new free form option and fix linting in exp_domain

* Fix linting in skill_services and prod_validation_jobs_one_off

* Fix linter in state_domain and stats_domain

* Fix smaller lint issues with rest of domain files

* Fix new lint issues

* Exp_domain linting fixes need some oversight

* Continue

* Add a new check for Args: docstring

* Revert "Exp_domain linting fixes need some oversight"

This reverts commit 1812e9d.

* Fix linting indentation in core/domain

* Fix lint issues in core/storage and core/platform

* Fix lint issues in rest of core

* Fix scripts linting

* Fix extensions linting

* Add misc linting

* Add new checks to pylint

* Readd all of the commented out checks

* fix fs domain

* Add tests

* Add comments

* Fix names and comments

* Final pass from look at github diff

* Fix more lint issues

* 2nd pass on PR

* Add tests for coverage

* Fix some more small indentation/description errors

* Address PR review comments

* Change the type to be more specific

* Address review comments

* Fix more list parameter definitions with no typeinfo

* Wrap the offending comment in jobs.py in a pylint-disable

* Address the review comments

* Accidentally removed a space when debugging that I added back in

* Address issues with PR

* Fix linting

* Fix more linting

* One more fix for syntax

* Increase coverage to 100% for backend tests and fix lint issue

* Fix lint issues from merge
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

3 participants