Skip to content

Inconsistent behavior with :arg syntax #264

Description

@avylove

Seeing some inconsistent behavior in docformatter 1.7.5.

Docformatter 1.7.5 (Last successful CI used 1.7.3)
CPython 3.11
Example file: https://github.com/jquast/blessed/blob/a34c6b1869b4dd467c6d1ab6895872bb72db7e0f/blessed/terminal.py

Docformatter flags the following

    def rgb_downconvert(self, red, green, blue):
        """
        Translate an RGB color to a color code of the terminal's color depth.

        :arg int red: RGB value of Red (0-255).
        :arg int green: RGB value of Green (0-255).
        :arg int blue: RGB value of Blue (0-255).
        :rtype: int
        :returns: Color code of downconverted RGB color
        """

Allowing Docformatter to fix it results in all the arguments running together

    def rgb_downconvert(self, red, green, blue):
        """
        Translate an RGB color to a color code of the terminal's color depth.

        :arg int red: RGB value of Red (0-255). :arg int green: RGB value of Green (0-255). :arg int
        blue: RGB value of Blue (0-255).
        :rtype: int
        :returns: Color code of downconverted RGB color
        """

Changing arg to param prevents it from being flagged

   def rgb_downconvert(self, red, green, blue):
        """
        Translate an RGB color to a color code of the terminal's color depth.

        :param int red: RGB value of Red (0-255).
        :param int green: RGB value of Green (0-255).
        :param int blue: RGB value of Blue (0-255).
        :rtype: int
        :returns: Color code of downconverted RGB color
        """

However, arg is not flagged elsewhere in the file and is processed fine with autodoc

    def move_yx(self, y, x):
        """
        A callable string that moves the cursor to the given ``(y, x)`` screen coordinates.

        :arg int y: vertical position, from top, *0*, to bottom of screen, *self.height - 1*.
        :arg int x: horizontal position, from left, *0*, to right edge of screen, *self.width - 1*.
        :rtype: ParameterizingString
        :returns: Callable string that moves the cursor to the given coordinates
        """

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: styleRelates to docstring format style (e.g., Google, NumPy, Sphinx)P: bugPEP 257 violation or existing functionality that doesn't work as documentedU: mediumA relatively medium urgency issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions