Skip to content

CFQ001 counts too many lines #9

@alexis974

Description

@alexis974

Bug description:
CFQ001 takes into account empty lines and comment lines when counting number of lines inside a function.

To Reproduce:
Steps to reproduce the behavior:

  1. Create a function that contains some empty lines and/or comments lines
  2. Run flake8 with the --max-function-length=N where N is the number of line of your function (without counting the empty line and comment line)

Expected behavior:
CFQ001 should only count lines of actual code. Taking into account empty lines and comment lines may lead to developers removing some comments or empty lines to fix CFQ001 linting error. Thus, making the code less readable.

Desktop:

  • OS:Manjaro Linux x86_64
  • Python : 3.9.7
  • Flake8: 4.0.1
  • Flake8-functions : 0.0.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions