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

AAA05 Blank line in block is not raised when additional blank line is followed by a hash comment #237

Open
jamescooke opened this issue Feb 24, 2024 · 0 comments

Comments

@jamescooke
Copy link
Owner

Current behaviour

When running Flake8-AAA on a test file that has additional blank lines in blocks, error AAA05 is not raised when those additional lines are followed by a hash-comment line.

For example:

# Line 1
def test_arrange_with_comment() -> None:
    x = 3

    # Y is a very important value
    y = 4

    result = x**2 + y**2

    assert result == 25

AAA05 is not raised on line 4, and the test passes linting.

The same happens for Assert blocks:

# Line 1
def test_assert_with_comment() -> None:
    x = 3
    y = 4

    result = x**2 + y**2

    assert result == 25

    # Check it again, Sam
    assert result == 25

The test passes lint unexpectedly.

Expected behaviour

It doesn't matter that the extra blank line is followed by a comment - AAA05 is raised.

  • In the first example, AAA05 is raised on line 4.
  • In the second example, AAA05 is raised on line 9.

Debugging info

Output of python --version:

Python 3.12.0

Output of flake8 --version:

7.0.0 (flake8-aaa: 0.17.0, mccabe: 0.7.0, pycodestyle: 2.11.1, pyflakes: 3.2.0) CPython 3.12.0 on Linux
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