docformatter fix does not consider parameters for added newlines

Aperta
#408 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@AtharvRG ci sta già lavorando.

Dal 31/10/2026.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
tooling

Direzione di ricerca

Reproduce the formatting with the configuration and command linked in setup.cfg and Makefile using docformatter v1.7.8, using the _publish_shapefile_request docstring as the example. Locate the logic that splits the summary and description and then inserts or indents parameter lines. Done means the description is followed by another newline and the :param entries retain their original indentation.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

fresh

Given a sentence detected with a ., which gets split into summary/description (as it should), the result doesn't seem to check correctly if the newlines it introduces cause an invalid structure by placing the description right on top of some parameter description.

For some reason, it picks to indent the parameters, which is incorrect.
It should instead add another newline and leave the parameters as they were.

    @geoserver_response_handling
    def _publish_shapefile_request(self,
                                   *,
                                   workspace_name: str,
                                   datastore_name: str,
                                   filename: str,
                                   ) -> requests.Response:
        """
-        Request to publish a shapefile in Geoserver. Does so by creating a `Feature type` in Geoserver.
+        Request to publish a shapefile in Geoserver.
 
-        :param workspace_name: Workspace where file will be published
-        :param datastore_name: Datastore where file will be published
-        :param filename: Name of the shapefile (with no extensions)
-        :returns: Response object
+        Does so by creating a `Feature type` in Geoserver.
+                :param workspace_name: Workspace where file will be published
+                :param datastore_name: Datastore where file will be published
+                :param filename: Name of the shapefile (with no extensions)
+                :returns: Response object
        """
        ...

config: https://github.com/Ouranosinc/cowbird/blob/2c3ee23c703ce18b16017ba77f0e211da91a0b47/setup.cfg#L43-L48

command: https://github.com/Ouranosinc/cowbird/blob/2c3ee23c703ce18b16017ba77f0e211da91a0b47/Makefile#L703-L713

using https://github.com/PyCQA/docformatter/releases/tag/v1.7.8

Lingua principale
Python
Stelle
600
Fork
107
Merge medio
22h 15m
PR unite (30g)
12

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PyCQA/docformatter

Tutte le issue di PyCQA/docformatter

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.