jdkandersson / flake8-docstrings-complete

Apache License 2.0
12 stars 2 forks source link

DCO024, DCO064 trigger on `https://<website>/` #29

Open tomtseng opened 2 months ago

tomtseng commented 2 months ago

Issue

Consider the function

    def foo(self, blah, bleh):
        """A function.

        Args:
            blah: A string.
                Note: Beware of tricky issue XYZ, documented at 
                https://github.com/jdkandersson/flake8-docstrings-complete/issues/999999
                TODO: Fix this issue.
            bleh: Another string.
        """
        ...

Then I get the spurious flake8 errors

robust_llm/config/configs.py:127:9: DCO024 "Note" argument should not be described in the docstring, more information: https://github.com/jdkandersson/flake8-docstrings-complete#fix-dco024
robust_llm/config/configs.py:127:9: DCO024 "TODO" argument should not be described in the docstring, more information: https://github.com/jdkandersson/flake8-docstrings-complete#fix-dco024
robust_llm/config/configs.py:127:9: DCO024 "https" argument should not be described in the docstring, more information: https://github.com/jdkandersson/flake8-docstrings-complete#fix-dco024

The same thing happens on DCO064 for class attributes.

Suggested fix

To handle https:// I think we could just not trigger the warning if the character after : is not whitespace.

Handling Note and TODO is trickier. If we want to allow these kinds of comments then maybe we look at their indentation level to distinguish them from blah: and bleh:.

Version