psf / psf/black

Docstrings should be forced to use triple quotes

Open
#982 2 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

F: docstrings S: needs discussion T: style
Dominant language
Python
Stars
41.8k
Forks
2.9k
Avg merge
5d 6h
Merged PRs (30d)
9

Description

Operating system: Windows 10 Pro 1809 + WSL (Ubuntu 18.04.2 LTS)
Python version: 3.6.7
Black version: 19.0b3
Does also happen on master: yes (via online formatter)

Related: #144.

Even if #144 is not implemented, Black should update docstrings to be triple double quotes.

def foo():
    "Hello"
    pass

# formats to:
def foo():
    """Hello"""
    pass

Thoughts?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named in the issue. Start by reproducing the example with Black 19.0b3 or the online formatter, then locate the docstring-formatting path; done means a one-line docstring is emitted with triple double quotes without changing its content.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.