mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 22:01:18 +00:00
Allow the if_not_else
Clippy lint
Specifically, the [`if_not_else`] lint will sometimes flag code to change the order of `if` and `else` bodies if this would allow a `!` to be removed. While perhaps tasteful in some cases, there are many cases in my experience where this bows to other competing concerns that impact readability. (Such as the relative sizes of the `if` and `else` bodies, or perhaps an ordering that just makes the code flow in a more natural way.) [`if_not_else`]: https://rust-lang.github.io/rust-clippy/master/index.html#/if_not_else
This commit is contained in:
parent
61f906d8e7
commit
25853e2377
5 changed files with 8 additions and 4 deletions
|
@ -790,7 +790,6 @@ impl Session {
|
|||
// But while this seemed to work for the project root, it
|
||||
// simply wouldn't result in any file notifications for changes
|
||||
// to files outside of the project root.
|
||||
#[allow(clippy::if_not_else)] // no! it reads better this way ---AG
|
||||
let watchers = if !self.client_capabilities().supports_relative_file_watcher() {
|
||||
tracing::warn!(
|
||||
"Your LSP client doesn't support file watching outside of project: \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue