glyph / python-docstring-mode

Emacs minor-mode for editing Python docstrings.
MIT License
70 stars 22 forks source link

Use global setting as a default in python-docstring-sentence-end-double-space #29

Closed ioreshnikov closed 2 years ago

ioreshnikov commented 3 years ago

I am on the fence about this diff.

On one hand, PEP8 explicitly suggests one uses double spaces after the sentence end in a comment, so t might indeed be a good default.

On the other, when a user has explicitly set up a global sentence-end-double-space to nil, it's probably a good idea to respect this setting in a docstring by default. python-mode seems to be respecting this default out of the box, so seeing a different behavior inside a docstring was an unpleasant surprise.

Best, Ivan

ioreshnikov commented 3 years ago

Ah, now I see it was discussed in #21 some years ago :)

On the other, one of the major motivations for this mode to exist is to avoid projects having diff noise when people have different configurations for re-wrapping docstrings.

That's a valid point, but as I said, the major mode respects sentence-end-double-space, so I advocate we should do the same in the docstrings for consistency's sake.

glyph commented 2 years ago

Thanks @ioreshnikov !

This makes sense from a personal-preference perspective, but I think that customization at the level of Emacs is generally the wrong place for this. I think I might actually want to remove python-docstring-sentence-end-double-space entirely, and instead find a configuration file local to the project, so that formatting is done consistently.)

I could be convinced that this is a reasonable default to draw from in some context, but I'd want to make sure that projects at least have the ability to enforce stability before making this honor a variable that might be set for other reasons.

Thanks very much for contributing, but having had half a year to consider, I think I'm going to reject this now.