Code Monkey home page Code Monkey logo

Comments (8)

myint avatar myint commented on July 17, 2024

Hi, finding your project (in a stackoverflow post) is what triggered me to start docformatter a few days ago. I ran pep257.py on one of my larger projects (non-github) and found plenty of formatting problems. I was using this style, which for some reason I thought was standard practice.

"""
My function.

More stuff.
"""

I put together this script just to quickly fix the easy issues. (The rest like missing return type documentation, I fixed by hand of course.) Currently I'm mainly only formatting the summary of the docstring and the quotes themselves. If you have any ideas, I'm welcome to collaboration. I'll add you as a collaborator on this repository.

from docformatter.

myint avatar myint commented on July 17, 2024

By the way, I added a TODO file with some of the features that docformatter is currently missing.

from docformatter.

florentx avatar florentx commented on July 17, 2024

Regarding the style, the requirement is The summary line may be on the same line as the opening quotes or on the next line.
So your example above is not wrong.

You have additional examples which look the same in PEP 287.
http://www.python.org/dev/peps/pep-0287/

from docformatter.

myint avatar myint commented on July 17, 2024

Ah, thanks for pointing that out. I should make that optional in docformatter as well.

from docformatter.

myint avatar myint commented on July 17, 2024

I've added a --pre-summary-newline option.

from docformatter.

myint avatar myint commented on July 17, 2024

I also added the convenience option --alternate-style which produces the above style.

from docformatter.

keleshev avatar keleshev commented on July 17, 2024

(sorry for not showing up with colloboration yet—busy with my "docopt" project). Comment about --alternate style:
pep257 is saying a lot of may and recommended and the whole thing is not mandatory, but in the pep257 I decided that all the recommendations should be followed by default, and it's not tools job to decide which of them to skip.

In the spirit of TSBOAPOOOWTDI I propose to support only one style (canonical, with all pep257 recommendation)—because that style is just beautiful.

from docformatter.

myint avatar myint commented on July 17, 2024

Right, it is not the tool's job to determine which to skip. Considering that, adding --alternate-style may be going too far. But I think the other options are necessary. Of course, the default (with no options) would enforce all recommendations.

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.