PyCQA / docformatter

Formats docstrings to follow PEP 257
https://pypi.python.org/pypi/docformatter
MIT License
524 stars 61 forks source link

v1.6.4 - Consider Not Capitalizing Proper Nouns if Other Capital Letters Exist in the Word #193

Closed rmartin16 closed 1 year ago

rmartin16 commented 1 year ago

This one may be a bit opinionated...but when a docstring starts with a proper noun that does not start with a capital letter, docformatter is now capitalizing it.

Example:

@pytest.fixture(scope="session", autouse=True)
def client():
-    """qBittorrent Client for testing session."""
+    """QBittorrent Client for testing session."""
    client = Client()

I can imagine other words like iOS, macOS, eBay etc. being affected.

Since detecting whether a word is a proper noun isn't trivial, perhaps detecting if the first word has other capital letters may be sufficient. Alternatively, saying, "wait on #144" may make sense too.

weibullguy commented 1 year ago

I wonder if a configuration option might be warranted? Say a list of words not to capitalize. I suspect for any given project, it would be a relatively short list. But, it would be generic enough that a user could choose to not capitalize words that were all lowercase if they wanted.

rmartin16 commented 1 year ago

That's probably the safest best to avoid additional corner cases...for instance, geoCities should be capitalized despite other capital letter.