B018 wrongly detects inline variable or attribute docstrings
See original GitHub issueHaving an inline attribute doc string or a module variable docstring, it is wrongly marked as B018 (sample from sphinx doc):
module_level_variable2 = 98765
"""int: Module level variable documented inline.
The docstring may span multiple lines. The type may optionally be specified
on the first line, separated by a colon.
"""
Issue Analytics
- State:
- Created 2 years ago
- Reactions:8
- Comments:16 (6 by maintainers)
Top Results From Across the Web
How to document a module constant in Python? - Stack Overflow
Unfortunately, variables (and constants) do not have docstrings. ... the ``Attributes`` section of the module docstring, or in an inline ...
Read more >PEP 8 – Style Guide for Python Code
Documentation Strings Write docstrings for all public modules, functions, classes, and methods. Docstrings are not necessary for non-public ...
Read more >LLVM Language Reference Manual
Abstract¶. This document is a reference manual for the LLVM assembly language. LLVM is a Static Single Assignment (SSA) based representation that provides ......
Read more >example_google — Solutions 0.0.1 documentation
Attributes : module_level_variable1 (int): Module level variables may be documented in ... or in an inline docstring immediately following the variable.
Read more >Python Docstrings Tutorial : Examples & Format for Pydoc ...
Python documentation string or commonly known as docstring, is a string ... Docstrings are accessible from the doc attribute (__doc__) for any of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

21.11.29 released reverting checking of strings for now. We will work on adding some pattern matching support into the string detection and probably default to ignoring this edge use case.
I also, 21.11.28 yanked from PyPI so it can not be installed to create noise.
Wow, that was fast!
@cooperlees @kasium Thx a lot!