docformatter fix does not consider parameters for added newlines

Abierto
#408 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@AtharvRG ya está trabajando en esto.

Desde el 31/10/2026.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
68/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python
Área
tooling

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Python
Estrellas
600
Forks
107
Merge medio
22 h 15 min
PR fusionados (30 d)
12

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de PyCQA/docformatter

Todos los issues de PyCQA/docformatter

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.