mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 18:28:24 +00:00
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:
parent
8fd29b3b60
commit
f1cdd108e6
262 changed files with 400 additions and 537 deletions
1
crates/ruff_dev/src/generate_docs.rs
Normal file
1
crates/ruff_dev/src/generate_docs.rs
Normal file
|
@ -0,0 +1 @@
|
|||
|
|
@ -2,8 +2,12 @@
|
|||
//!
|
||||
//! Within the ruff repository you can run it with `cargo dev`.
|
||||
|
||||
use anyhow::Result;
|
||||
use clap::{Parser, Subcommand};
|
||||
|
||||
mod generate_all;
|
||||
mod generate_cli_help;
|
||||
mod generate_docs;
|
||||
mod generate_json_schema;
|
||||
mod generate_options;
|
||||
mod generate_rules_table;
|
||||
|
@ -13,9 +17,6 @@ mod print_tokens;
|
|||
mod round_trip;
|
||||
mod utils;
|
||||
|
||||
use anyhow::Result;
|
||||
use clap::{Parser, Subcommand};
|
||||
|
||||
const ROOT_DIR: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/../../");
|
||||
|
||||
#[derive(Parser)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue