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

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

Open
tomtseng opened this issue Jul 5, 2024 · 0 comments
Open

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

tomtseng opened this issue Jul 5, 2024 · 0 comments

Comments

@tomtseng
Copy link

tomtseng commented Jul 5, 2024

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

  • Python 3.10
  • flake8 7.0.0
  • flake8-docstrings-complete 1.3.0
@tomtseng tomtseng changed the title DCO024, DCO064 too strict DCO024, DCO064 trigger on https://<website>/ Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant