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

More ruff rules #154

Merged
merged 11 commits into from
Jul 16, 2023
Merged

More ruff rules #154

merged 11 commits into from
Jul 16, 2023

Commits on Jul 15, 2023

  1. Enforce RUF lint rules

    Ruff has it's own custom set of linter rules, this enables all of them.
    ItsDrike committed Jul 15, 2023
    Configuration menu
    Copy the full SHA
    92663be View commit details
    Browse the repository at this point in the history
  2. Enable PTH linter rule

    This enables all ruff's flake8-use-pathlib (PTH) extension rules.
    ItsDrike committed Jul 15, 2023
    Configuration menu
    Copy the full SHA
    5d6910f View commit details
    Browse the repository at this point in the history
  3. Enable ASYNC linter rules

    This enables all ruff's flake8-async (ASYNC) rules.
    ItsDrike committed Jul 15, 2023
    Configuration menu
    Copy the full SHA
    57a9769 View commit details
    Browse the repository at this point in the history
  4. Enable Q linter rules

    This enables all ruff's flake8-quotes (Q) rules.
    ItsDrike committed Jul 15, 2023
    Configuration menu
    Copy the full SHA
    93719ba View commit details
    Browse the repository at this point in the history
  5. Enable RET linter rules

    This enables all ruff's flake8-return (RET) rules.
    ItsDrike committed Jul 15, 2023
    Configuration menu
    Copy the full SHA
    ed2c9cb View commit details
    Browse the repository at this point in the history
  6. Enable UP linter rules

    This enables all ruff's pyupgrade (UP) rules.
    
    However UP024 (using errors that alias OSError) is ignored, as that
    prohibits use of exceptions like `IOError`, which is utilized pretty
    extensively in mcproto.
    ItsDrike committed Jul 15, 2023
    Configuration menu
    Copy the full SHA
    8f76213 View commit details
    Browse the repository at this point in the history
  7. Enable PL linter rules

    This enables all ruff's pylint (PL) rules.
    
    However PLR2004 (using unnamed numerical constants) is ignored, as these
    kinds of constants are used all over the codebase, in comparisons, etc.
    As mcproto is a fairly low level library, this is not surprising, and in
    most cases, it's easy to understand what the numerical constant is in
    the context of that comparison.
    ItsDrike committed Jul 15, 2023
    Configuration menu
    Copy the full SHA
    24503f5 View commit details
    Browse the repository at this point in the history
  8. Enable PGH linter rules

    This enables all ruff's pygrep-hooks (PGH) rules.
    
    However PGH003 (using specific rule codes in type ignores) is ignored,
    as we're using pyright rather than mypy, and while there are some
    rulecodes for pyright and we could be more specific, most of the
    violations just fall under the same (general typing issues) category,
    which isn't very helpful for categorizing the issue. Because of that,
    this would just be annoying to do without any huge benefit for it.
    ItsDrike committed Jul 15, 2023
    Configuration menu
    Copy the full SHA
    49261fc View commit details
    Browse the repository at this point in the history
  9. Add todo to unignore PT011

    ItsDrike committed Jul 15, 2023
    Configuration menu
    Copy the full SHA
    89399c1 View commit details
    Browse the repository at this point in the history

Commits on Jul 16, 2023

  1. Enable INT linter rules

    This enables all ruff's flake8-gettext (INT) rules.
    ItsDrike committed Jul 16, 2023
    Configuration menu
    Copy the full SHA
    60b019d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0b49d66 View commit details
    Browse the repository at this point in the history