astral-sh/ruff

Implement pygrep-hooks

JonathanPlasse opened this issue · 8 comments

pygrep-hooks

  • python-check-blanket-noqa: Enforce that noqa annotations always occur with specific codes. Sample annotations: # noqa: F401, # noqa: F401,W203
  • python-check-blanket-type-ignore: Enforce that # type: ignore annotations always occur with specific codes. Sample annotations: # type: ignore[attr-defined], # type: ignore[attr-defined, name-defined]
  • python-check-mock-methods: Prevent common mistakes of assert mck.not_called(), assert mck.called_once_with(...) and mck.assert_called.
  • python-no-eval: A quick check for the eval() built-in function
  • python-no-log-warn: A quick check for the deprecated .warn() method of python loggers
  • python-use-type-annotations: Enforce that python3.6+ type annotations are used instead of type comments

May be tag this issue good first issue.

I will implement python-no-eval.

I'm working on python-no-log-warn.

Working on python-check-blanket-type-ignore now.

Hey,

python-use-type-annotations is marked as implemented in the OP. But it isn't, is it? 🤔

fin swimmer

Hey,

python-use-type-annotations is marked as implemented in the OP. But it isn't, is it? thinking

fin swimmer

It is implemented as PYI033.

It is implemented as PYI033.

Hm, looks like this is only for stub files (.pyi) I cannot get it work for normal python files. 🤷‍♂️