• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

psf / black / 774
96%

Build:
DEFAULT BRANCH: master
Ran 08 May 2020 01:11PM UTC
Jobs 4
Files 4
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
774

push

travis-ci-com

web-flow
Re-indent the contents of docstrings (#1053)

* Re-indent the contents of docstrings when indentation changes

Keeping the contents of docstrings completely unchanged when
re-indenting (from 2-space intents to 4, for example) can cause
incorrect docstring indentation:

```
class MyClass:
  """Multiline
  class docstring
  """

  def method(self):
    """Multiline
    method docstring
    """
    pass
```
...becomes:
```
class MyClass:
    """Multiline
  class docstring
  """

    def method(self):
        """Multiline
    method docstring
    """
        pass
```

This uses the PEP 257 algorithm for determining docstring indentation,
and adjusts the contents of docstrings to match their new indentation
after `black` is applied.

A small normalization is necessary to `assert_equivalent` because the
trees are technically no longer precisely equivalent -- some constant
strings have changed.  When comparing two ASTs, whitespace after
newlines within constant strings is thus folded into a single space.

Co-authored-by: Luka Zakrajšek <luka@bancek.net>

* Extract the inner `_v` method to decrease complexity

This reduces the cyclomatic complexity to a level that makes flake8 happy.

* Blacken blib2to3's docstring which had an over-indent

Co-authored-by: Luka Zakrajšek <luka@bancek.net>
Co-authored-by: Zsolt Dollenstein <zsol.zsol@gmail.com>

72 of 72 new or added lines in 2 files covered. (100.0%)

4141 of 4298 relevant lines covered (96.35%)

2.89 hits per line

Jobs
ID Job ID Ran Files Coverage
1 774.1 (TEST_CMD="pre-commit run --all-files") 08 May 2020 01:11PM UTC 0
0.0
Travis Job 774.1
2 774.2 (TEST_CMD="coverage run tests/test_black.py") 08 May 2020 01:13PM UTC 0
96.3
Travis Job 774.2
3 774.3 (TEST_CMD="coverage run tests/test_black.py") 08 May 2020 01:13PM UTC 0
96.3
Travis Job 774.3
4 774.4 (TEST_CMD="coverage run tests/test_black.py") 08 May 2020 01:13PM UTC 0
96.4
Travis Job 774.4
Source Files on build 774
Detailed source file information is not available for this build.
  • Back to Repo
  • Build #774
  • a4c11a75 on github
  • Prev Build on master (#1731)
  • Next Build on master (#777)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc