Skip to content

Add Markdown documentation for existing lint rules #2646

@charliermarsh

Description

@charliermarsh

If we write documentation on the #[violation] macro:

/// ### What it does
/// Checks for `self.assertRaises(Exception)`.
///
/// ## Why is this bad?
/// `assertRaises(Exception)` can lead to your test passing even if the
/// code being tested is never executed due to a typo.
///
/// Either assert for a more specific exception (builtin or custom), use
/// `assertRaisesRegex` or the context manager form of `assertRaises`.
#[violation]
pub struct NoAssertRaisesException;

This explanation shows up with ruff rule B017, and in the docs:

We'll track progress here:

  • airflow
  • eradicate
  • flake8-2020
  • flake8-annotations
  • flake8-async
  • flake8-bandit
  • flake8-blind-except
  • flake8-boolean-trap
  • flake8-bugbear
  • flake8-builtins
  • flake8-commas
  • flake8-comprehensions
  • flake8-copyright
  • flake8-datetimez
  • flake8-debugger
  • flake8-django
  • flake8-errmsg
  • flake8-executable
  • flake8-fixme
  • flake8-future-annotations
  • flake8-gettext
  • flake8-implicit-str-concat
  • flake8-import-conventions
  • flake8-logging-format
  • flake8-no-pep420
  • flake8-pie
  • flake8-print
  • flake8-pyi
  • flake8-pytest-style
  • flake8-quotes
  • flake8-raise
  • flake8-return
  • flake8-self
  • flake8-simplify
  • flake8-slots
  • flake8-tidy-imports
  • flake8-todos
  • flake8-type-checking
  • flake8-unused-arguments
  • flake8-use-pathlib
  • flynt
  • isort
  • mccabe
  • numpy
  • pandas-vet
  • pep8-naming
  • perflint
  • pycodestyle
  • pydocstyle
  • pyflakes
  • pygrep-hooks
  • pylint
  • pyupgrade
  • ruff
  • tryceratops

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