mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-24 05:25:17 +00:00
![]()
Some checks are pending
CI / cargo fmt (push) Waiting to run
CI / cargo clippy (push) Blocked by required conditions
CI / cargo test (linux) (push) Blocked by required conditions
CI / cargo test (linux, release) (push) Blocked by required conditions
CI / cargo test (windows) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Waiting to run
CI / cargo build (msrv) (push) Blocked by required conditions
CI / cargo fuzz build (push) Blocked by required conditions
CI / fuzz parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / cargo shear (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / Determine changes (push) Waiting to run
CI / pre-commit (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / test ruff-lsp (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions
## Summary Added some extra notes on why you should have focused try...except blocks to [TRY300](https://docs.astral.sh/ruff/rules/try-consider-else/). When fixing a violation of this rule, a co-worker of mine (very understandably) asked why this was better. The current docs just say putting the return in the else is "more explicit", but if you look at the [linked reference in the python documentation](https://docs.python.org/3/tutorial/errors.html) they are more clear on why violations like this is bad: > The use of the else clause is better than adding additional code to the [try](https://docs.python.org/3/reference/compound_stmts.html#try) clause because it avoids accidentally catching an exception that wasn’t raised by the code being protected by the try … except statement. This is my attempt at adding more context to the docs on this. Open to suggestions for wording! --------- Co-authored-by: dylwil3 <dylwil3@gmail.com> |
||
---|---|---|
.. | ||
resources | ||
src | ||
Cargo.toml |