docformatter fix does not consider parameters for added newlines

オープン
#408 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@AtharvRG がすでに取り組んでいます。

2026年10月31日 から。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
tooling

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
Python
スター
600
フォーク
107
平均マージ
22時間 15分
マージ済み PR(30日)
12

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

PyCQA/docformatter のほかの issue

PyCQA/docformatter の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。