Derive explanation method on Rule struct via rustdoc (#2642)

```console
❯ cargo run rule B017
    Finished dev [unoptimized + debuginfo] target(s) in 0.13s
     Running `target/debug/ruff rule B017`
no-assert-raises-exception

Code: B017 (flake8-bugbear)

### 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`.
```
This commit is contained in:
Charlie Marsh 2023-02-07 17:23:29 -05:00 committed by GitHub
parent 8fd29b3b60
commit f1cdd108e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
262 changed files with 400 additions and 537 deletions

View file

@ -75,7 +75,7 @@ def main(*, name: str, code: str, linter: str) -> None: # noqa: PLR0915
fp.write(
"""use ruff_macros::derive_message_formats;
use crate::define_violation;
use ruff_macros::define_violation;
use crate::violation::Violation;
use crate::checkers::ast::Checker;