Is there a better way to disable warnings and errors on aligned code blocks than ending each lin ewith ` # noqa`?

231 views Asked by At
monthsdays = {
    'January'   : 31,  # noqa E203
    'February'  : 29,  # noqa E203
    'March'     : 31,  # noqa E203
    'April'     : 30,  # noqa E203
    'May'       : 30,  # noqa E203
    'June'      : 31,  # noqa E203
    'July'      : 31,  # noqa E203
    'August'    : 31,  # noqa E203
    'September' : 30,  # noqa E203
    'October'   : 31,  # noqa E203
    'November'  : 30,  # noqa E203
    'December'  : 31,  # noqa E203
}

Text alignment improves code readability but conflicts with linting. The only ways I know of is all code, per-project and per-module through configuration files. Disabling a specific test on a specific block of code seems to be the best approach.

0

There are 0 answers