Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent behavior with :arg syntax #264

Open
avylove opened this issue Aug 25, 2023 · 1 comment
Open

Inconsistent behavior with :arg syntax #264

avylove opened this issue Aug 25, 2023 · 1 comment
Labels
C: style Relates to docstring format style (e.g., Google, NumPy, Sphinx) P: bug PEP 257 violation or existing functionality that doesn't work as documented U: medium A relatively medium urgency issue

Comments

@avylove
Copy link

avylove commented Aug 25, 2023

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
        """
@github-actions github-actions bot added the fresh This is a new issue label Aug 25, 2023
@weibullguy weibullguy added P: bug PEP 257 violation or existing functionality that doesn't work as documented C: style Relates to docstring format style (e.g., Google, NumPy, Sphinx) and removed fresh This is a new issue labels Aug 27, 2023
@github-actions github-actions bot added the U: medium A relatively medium urgency issue label Aug 27, 2023
@pedropaulofb
Copy link

I am facing a similar situation, as I reported on the issue #271. The problem started on version 1.7.4.

jquast added a commit to jquast/blessed that referenced this issue Dec 14, 2023
- fix for 'pylint: disable'

- pin docformatter, As it seems the bug that @avylove created may not
  been addressed, freeze docformatter for now, to prevent failing CI

  PyCQA/docformatter#264
jquast added a commit to jquast/blessed that referenced this issue Dec 17, 2023
Closes #158

Also pins docformatter due to related issue PyCQA/docformatter#264
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: style Relates to docstring format style (e.g., Google, NumPy, Sphinx) P: bug PEP 257 violation or existing functionality that doesn't work as documented U: medium A relatively medium urgency issue
Projects
None yet
Development

No branches or pull requests

3 participants