Code Monkey home page Code Monkey logo

Comments (4)

myint avatar myint commented on July 17, 2024

I can't seem to reproduce the problem, can you give an example?

https://github.com/myint/docformatter/blob/7fa355102584e2d97e4a6251be9807d05c413d6f/test_docformatter.py#L253-L266

from docformatter.

weibullguy avatar weibullguy commented on July 17, 2024

@lordyavin can you confirm that your issue is given a docstring with the following whitespace

Summary line    \n
        \n
Elaborate description    \n

docformatter will strip the whitespaces after "line" and "description", but will leave untouched the whitespace on the line between. It is this un-removed whitespace on the blank line that pycodestyle complains about. docformatter should strip the whitespaces on the blank line as well.

This would be an enhancement to docformatter since the whitespace in the blank line is PEP-257 compliant, but not PEP-8 compliant.

from docformatter.

lordyavin avatar lordyavin commented on July 17, 2024

I'm sorry, I don't have access to the sources that I edited when I opened this issue and currently I don't use python very much. So I can't confirm your analysis.

from docformatter.

misho104 avatar misho104 commented on July 17, 2024

It may depend on the interpretation of PEP-257, which says Multi-line docstrings consist of a summary line just like a one-line docstring, followed by a blank line, together with The entire docstring is indented the same as the quotes at its first line (see example below)..

As the example has no whitespaces in the blank line, the second statement is not in effect for "blank lines", and PEP-257 seems to prefer the whitespaces removed.

In any case, I agree that this will be an enhancement; I usually run pydocformatter after applying Black, and Black removes the whitespaces for me.

from docformatter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.