collab-uniba / pynblint

Pynblint is a linter for Python Jupyter notebooks.
MIT License
40 stars 2 forks source link

Detect multiline comments used instead of Markdown text #79

Closed louieQ closed 2 years ago

louieQ commented 2 years ago

Long, multiline comments are less readable than Markdown formatted text.

Develop a new linting rule to detect whether long, multiline comments are used in code cells.

We might fire this rule when we find at least three consecutive comment lines within a single code cell (the minimum number of comment lines – i.e., three in the default case – should be customizable, and thus part of the Pynblint configuration).

E.g.:

# This comment lines explain the purpose of this cell.
# They should rather be put above the cell as Markdown text.
# We might fire this rule whenever we find at least 3 consecutive lines like these

print("Hello world!")