Skip to content

Allow custom exceptions to N806, N815, N816 #16551

@janosh

Description

@janosh

Summary

in the physical sciences, certain variables have widely used notations that conflict with Python's snake case convention. e.g.

# kT: initial temperature in metal units (K)
kT = 80 * Units.temperature  # noqa: N816

would be great if you could whitelist certain non-snake case variables in pyproject.toml

[tool.ruff.lint]
select = ["ALL"]
ignore = [
    "ANN002",  # Checks that *args arguments have type annotations.
    "ANN003",  # Checks that **kwargs arguments have type annotations.
    # ...
]
pydocstyle.convention = "google"
isort.split-on-trailing-comma = false
mixed-case-variable-in-global-scope-whitelist = ["kT"]  # new config option proposal

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions