Skip to content

D100 with —add-noqa breaks shebang lines #14442

Open
@pjspereira

Description

The —add-noqa breaks shebang lines with the D100 rule on files with no module documentation. Can the shebang line be ignored and the D100 error be assigned to the second line, if it exists?

Example output from ruff check --add-noqa --select D100 --isolated .:

#!/usr/bin/env python  # noqa: D100

import sys

if __name__==__main__’:
    print(sys.argv)

If this script is marked executable, the noqa comment will be passed as a filename to python, which will crash the interpreter, since the file does not exist.

Keywords: shebang D100
Ruff version: 0.6.4

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedContributions especially welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions