Move Clippy configuration to the workspace level (#8891)

Marshall Bowers created

This PR moves the Clippy configuration up to the workspace level.

We're using the [`lints`
table](https://doc.rust-lang.org/cargo/reference/workspaces.html#the-lints-table)
to configure the Clippy ruleset in the workspace's `Cargo.toml`.

Each crate in the workspace now has the following in their own
`Cargo.toml` to inherit the lints from the workspace:

```toml
[lints]
workspace = true
```

This allows for configuring rust-analyzer to show Clippy lints in the
editor by using the following configuration in your Zed `settings.json`:

```json
{
  "lsp": {
    "rust-analyzer": {
      "initialization_options": {
        "check": {
          "command": "clippy"
        }
      }
    }
  }
```

Release Notes:

- N/A

Change summary

Cargo.lock                                     |  2 
Cargo.toml                                     | 43 ++++++++++++++++
crates/activity_indicator/Cargo.toml           |  3 +
crates/ai/Cargo.toml                           |  3 +
crates/assets/Cargo.toml                       |  3 +
crates/assistant/Cargo.toml                    |  3 +
crates/audio/Cargo.toml                        |  3 +
crates/auto_update/Cargo.toml                  |  3 +
crates/breadcrumbs/Cargo.toml                  |  3 +
crates/call/Cargo.toml                         |  3 +
crates/channel/Cargo.toml                      |  3 +
crates/cli/Cargo.toml                          |  3 +
crates/client/Cargo.toml                       |  3 +
crates/clock/Cargo.toml                        |  3 +
crates/collab/Cargo.toml                       |  3 +
crates/collab_ui/Cargo.toml                    |  3 +
crates/collections/Cargo.toml                  |  3 +
crates/color/Cargo.toml                        |  3 +
crates/command_palette/Cargo.toml              |  3 +
crates/command_palette_hooks/Cargo.toml        |  3 +
crates/copilot/Cargo.toml                      |  3 +
crates/copilot_ui/Cargo.toml                   |  3 +
crates/db/Cargo.toml                           |  3 +
crates/diagnostics/Cargo.toml                  |  3 +
crates/editor/Cargo.toml                       |  3 +
crates/extension/Cargo.toml                    |  3 +
crates/extension_api/Cargo.toml                |  3 +
crates/extensions_ui/Cargo.toml                |  3 +
crates/feature_flags/Cargo.toml                |  3 +
crates/feedback/Cargo.toml                     |  3 +
crates/file_finder/Cargo.toml                  |  3 +
crates/fs/Cargo.toml                           |  3 +
crates/fsevent/Cargo.toml                      |  6 +
crates/fuzzy/Cargo.toml                        |  3 +
crates/git/Cargo.toml                          |  3 +
crates/go_to_line/Cargo.toml                   |  3 +
crates/gpui/Cargo.toml                         |  3 +
crates/gpui_macros/Cargo.toml                  |  3 +
crates/install_cli/Cargo.toml                  |  3 +
crates/journal/Cargo.toml                      |  3 +
crates/language/Cargo.toml                     |  3 +
crates/language_selector/Cargo.toml            |  3 +
crates/language_tools/Cargo.toml               |  3 +
crates/languages/Cargo.toml                    |  3 +
crates/live_kit_client/Cargo.toml              |  3 +
crates/live_kit_server/Cargo.toml              |  3 +
crates/lsp/Cargo.toml                          |  3 +
crates/markdown_preview/Cargo.toml             |  3 +
crates/media/Cargo.toml                        |  3 +
crates/menu/Cargo.toml                         |  3 +
crates/multi_buffer/Cargo.toml                 |  3 +
crates/node_runtime/Cargo.toml                 |  3 +
crates/notifications/Cargo.toml                |  3 +
crates/outline/Cargo.toml                      |  3 +
crates/picker/Cargo.toml                       |  3 +
crates/prettier/Cargo.toml                     |  3 +
crates/project/Cargo.toml                      |  3 +
crates/project_core/Cargo.toml                 |  3 +
crates/project_panel/Cargo.toml                |  3 +
crates/project_symbols/Cargo.toml              |  3 +
crates/quick_action_bar/Cargo.toml             |  3 +
crates/recent_projects/Cargo.toml              |  3 +
crates/refineable/Cargo.toml                   |  3 +
crates/refineable/derive_refineable/Cargo.toml |  3 +
crates/release_channel/Cargo.toml              |  3 +
crates/rich_text/Cargo.toml                    |  3 +
crates/rope/Cargo.toml                         |  3 +
crates/rpc/Cargo.toml                          |  3 +
crates/search/Cargo.toml                       |  3 +
crates/semantic_index/Cargo.toml               |  3 +
crates/settings/Cargo.toml                     |  3 +
crates/snippet/Cargo.toml                      |  3 +
crates/sqlez/Cargo.toml                        |  3 +
crates/sqlez_macros/Cargo.toml                 |  3 +
crates/story/Cargo.toml                        |  3 +
crates/storybook/Cargo.toml                    |  3 +
crates/sum_tree/Cargo.toml                     |  3 +
crates/task/Cargo.toml                         |  3 +
crates/tasks_ui/Cargo.toml                     |  3 +
crates/telemetry_events/Cargo.toml             |  3 +
crates/terminal/Cargo.toml                     |  3 +
crates/terminal_view/Cargo.toml                |  3 +
crates/text/Cargo.toml                         |  3 +
crates/theme/Cargo.toml                        |  3 +
crates/theme_importer/Cargo.toml               |  3 +
crates/theme_selector/Cargo.toml               |  3 +
crates/time_format/Cargo.toml                  |  3 +
crates/ui/Cargo.toml                           |  3 +
crates/util/Cargo.toml                         |  3 +
crates/vcs_menu/Cargo.toml                     |  3 +
crates/vim/Cargo.toml                          |  3 +
crates/welcome/Cargo.toml                      |  3 +
crates/workspace/Cargo.toml                    |  3 +
crates/zed/Cargo.toml                          |  3 +
crates/zed_actions/Cargo.toml                  |  3 +
extensions/gleam/Cargo.toml                    |  3 +
tooling/xtask/Cargo.toml                       |  3 +
tooling/xtask/src/main.rs                      | 51 --------------------
98 files changed, 328 insertions(+), 56 deletions(-)

Detailed changes

Cargo.lock 🔗

@@ -3927,7 +3927,7 @@ dependencies = [
 
 [[package]]
 name = "fsevent"
-version = "2.0.2"
+version = "0.1.0"
 dependencies = [
  "bitflags 2.4.2",
  "fsevent-sys 3.1.0",

Cargo.toml 🔗

@@ -322,8 +322,6 @@ features = [
     "Win32_System_Ole",
 ]
 
-
-
 [patch.crates-io]
 tree-sitter = { git = "https://github.com/tree-sitter/tree-sitter", rev = "e4a23971ec3071a09c1e84816954c98f96e98e52" }
 # Workaround for a broken nightly build of gpui: See #7644 and revisit once 0.5.3 is released.
@@ -350,5 +348,46 @@ debug = "limited"
 lto = "thin"
 codegen-units = 1
 
+[workspace.lints.clippy]
+dbg_macro = "deny"
+todo = "deny"
+
+# These are all of the rules that currently have violations in the Zed
+# codebase.
+#
+# We'll want to drive this list down by either:
+# 1. fixing violations of the rule and begin enforcing it
+# 2. deciding we want to allow the rule permanently, at which point
+#    we should codify that separately above.
+#
+# This list shouldn't be added to; it should only get shorter.
+# =============================================================================
+
+# There are a bunch of rules currently failing in the `style` group, so
+# allow all of those, for now.
+style = "allow"
+
+# Individual rules that have violations in the codebase:
+almost_complete_range = "allow"
+arc_with_non_send_sync = "allow"
+await_holding_lock = "allow"
+borrow_deref_ref = "allow"
+borrowed_box = "allow"
+cast_abs_to_unsigned = "allow"
+cmp_owned = "allow"
+derive_ord_xor_partial_ord = "allow"
+eq_op = "allow"
+implied_bounds_in_impls = "allow"
+let_underscore_future = "allow"
+map_entry = "allow"
+never_loop = "allow"
+non_canonical_clone_impl = "allow"
+non_canonical_partial_ord_impl = "allow"
+reversed_empty_ranges = "allow"
+single_range_in_vec_init = "allow"
+suspicious_to_owned = "allow"
+type_complexity = "allow"
+unnecessary_to_owned = "allow"
+
 [workspace.metadata.cargo-machete]
 ignored = ["bindgen", "cbindgen", "prost_build", "serde"]

crates/activity_indicator/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/activity_indicator.rs"
 doctest = false

crates/ai/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/ai.rs"
 doctest = false

crates/assets/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [dependencies]
 anyhow.workspace = true
 gpui.workspace = true

crates/assistant/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/assistant.rs"
 doctest = false

crates/audio/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/audio.rs"
 doctest = false

crates/auto_update/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/auto_update.rs"
 doctest = false

crates/breadcrumbs/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/breadcrumbs.rs"
 doctest = false

crates/call/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/call.rs"
 doctest = false

crates/channel/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/channel.rs"
 doctest = false

crates/cli/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/cli.rs"
 doctest = false

crates/client/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/client.rs"
 doctest = false

crates/clock/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/clock.rs"
 doctest = false

crates/collab/Cargo.toml 🔗

@@ -7,6 +7,9 @@ version = "0.44.0"
 publish = false
 license = "AGPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [[bin]]
 name = "collab"
 

crates/collab_ui/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/collab_ui.rs"
 doctest = false

crates/collections/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "Apache-2.0"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/collections.rs"
 doctest = false

crates/color/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [features]
 default = []
 

crates/command_palette/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/command_palette.rs"
 doctest = false

crates/copilot/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/copilot.rs"
 doctest = false

crates/copilot_ui/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/copilot_ui.rs"
 doctest = false

crates/db/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/db.rs"
 doctest = false

crates/diagnostics/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/diagnostics.rs"
 doctest = false

crates/editor/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/editor.rs"
 doctest = false

crates/extension/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/extension_store.rs"
 

crates/extension_api/Cargo.toml 🔗

@@ -4,6 +4,9 @@ version = "0.1.0"
 edition = "2021"
 license = "Apache-2.0"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/extension_api.rs"
 

crates/extensions_ui/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/extensions_ui.rs"
 

crates/feature_flags/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/feature_flags.rs"
 

crates/feedback/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/feedback.rs"
 

crates/file_finder/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/file_finder.rs"
 doctest = false

crates/fs/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/fs.rs"
 

crates/fsevent/Cargo.toml 🔗

@@ -1,10 +1,12 @@
 [package]
 name = "fsevent"
-version = "2.0.2"
-license = "MIT"
+version = "0.1.0"
 edition = "2021"
 publish = false
+license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
 
 [lib]
 path = "src/fsevent.rs"

crates/fuzzy/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/fuzzy.rs"
 doctest = false

crates/git/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/git.rs"
 

crates/go_to_line/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/go_to_line.rs"
 doctest = false

crates/gpui/Cargo.toml 🔗

@@ -7,6 +7,9 @@ description = "Zed's GPU-accelerated UI framework"
 publish = false
 license = "Apache-2.0"
 
+[lints]
+workspace = true
+
 [features]
 test-support = [
     "backtrace",

crates/gpui_macros/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "Apache-2.0"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/gpui_macros.rs"
 proc-macro = true

crates/install_cli/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/install_cli.rs"
 

crates/journal/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/journal.rs"
 doctest = false

crates/language/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/language.rs"
 doctest = false

crates/language_selector/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/language_selector.rs"
 doctest = false

crates/language_tools/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/language_tools.rs"
 doctest = false

crates/languages/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [dependencies]
 anyhow.workspace = true
 async-compression.workspace = true

crates/live_kit_client/Cargo.toml 🔗

@@ -6,6 +6,9 @@ description = "Bindings to LiveKit Swift client SDK"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/live_kit_client.rs"
 doctest = false

crates/live_kit_server/Cargo.toml 🔗

@@ -6,6 +6,9 @@ description = "SDK for the LiveKit server API"
 publish = false
 license = "AGPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/live_kit_server.rs"
 doctest = false

crates/lsp/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/lsp.rs"
 doctest = false

crates/media/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "Apache-2.0"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/media.rs"
 doctest = false

crates/menu/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/menu.rs"
 doctest = false

crates/multi_buffer/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/multi_buffer.rs"
 doctest = false

crates/node_runtime/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/node_runtime.rs"
 doctest = false

crates/notifications/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/notification_store.rs"
 doctest = false

crates/outline/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/outline.rs"
 doctest = false

crates/picker/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/picker.rs"
 doctest = false

crates/prettier/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/prettier.rs"
 doctest = false

crates/project/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/project.rs"
 doctest = false

crates/project_core/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
 [features]
 test-support = [

crates/project_panel/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/project_panel.rs"
 doctest = false

crates/project_symbols/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/project_symbols.rs"
 doctest = false

crates/quick_action_bar/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/quick_action_bar.rs"
 doctest = false

crates/recent_projects/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/recent_projects.rs"
 doctest = false

crates/refineable/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "Apache-2.0"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/refineable.rs"
 doctest = false

crates/release_channel/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [dependencies]
 gpui.workspace = true
 once_cell = "1.19.0"

crates/rich_text/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/rich_text.rs"
 doctest = false

crates/rope/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/rope.rs"
 

crates/rpc/Cargo.toml 🔗

@@ -6,6 +6,9 @@ version = "0.1.0"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/rpc.rs"
 doctest = false

crates/search/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/search.rs"
 doctest = false

crates/semantic_index/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/semantic_index.rs"
 doctest = false

crates/settings/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/settings.rs"
 doctest = false

crates/snippet/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/snippet.rs"
 doctest = false

crates/sqlez/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [dependencies]
 anyhow.workspace = true
 collections.workspace = true

crates/sqlez_macros/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/sqlez_macros.rs"
 proc-macro = true

crates/story/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [dependencies]
 gpui.workspace = true
 itertools = { package = "itertools", version = "0.10" }

crates/storybook/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [[bin]]
 name = "storybook"
 path = "src/storybook.rs"

crates/sum_tree/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "Apache-2.0"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/sum_tree.rs"
 doctest = false

crates/task/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [dependencies]
 anyhow.workspace = true
 collections.workspace = true

crates/tasks_ui/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [dependencies]
 anyhow.workspace = true
 editor.workspace = true

crates/terminal/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/terminal.rs"
 doctest = false

crates/terminal_view/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/terminal_view.rs"
 doctest = false

crates/text/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/text.rs"
 doctest = false

crates/theme/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [features]
 default = []
 stories = ["dep:story"]

crates/theme_importer/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [dependencies]
 anyhow.workspace = true
 clap = { workspace = true, features = ["derive"] }

crates/theme_selector/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/theme_selector.rs"
 doctest = false

crates/time_format/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/time_format.rs"
 doctest = false

crates/ui/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 name = "ui"
 path = "src/ui.rs"

crates/util/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "Apache-2.0"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/util.rs"
 doctest = true

crates/vcs_menu/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [dependencies]
 anyhow.workspace = true
 fs.workspace = true

crates/vim/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/vim.rs"
 doctest = false

crates/welcome/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/welcome.rs"
 

crates/workspace/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 path = "src/workspace.rs"
 doctest = false

crates/zed/Cargo.toml 🔗

@@ -6,6 +6,9 @@ version = "0.126.0"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [lib]
 name = "zed"
 path = "src/zed.rs"

crates/zed_actions/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [dependencies]
 gpui.workspace = true
 serde.workspace = true

extensions/gleam/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "Apache-2.0"
 
+[lints]
+workspace = true
+
 [dependencies]
 zed_extension_api = { path = "../../crates/extension_api" }
 

tooling/xtask/Cargo.toml 🔗

@@ -5,6 +5,9 @@ edition = "2021"
 publish = false
 license = "GPL-3.0-or-later"
 
+[lints]
+workspace = true
+
 [dependencies]
 anyhow.workspace = true
 clap = { workspace = true, features = ["derive"] }

tooling/xtask/src/main.rs 🔗

@@ -63,57 +63,6 @@ fn run_clippy(args: ClippyArgs) -> Result<()> {
     #[cfg(not(target_os = "windows"))]
     clippy_command.args(["--deny", "warnings"]);
 
-    /// These are all of the rules that currently have violations in the Zed
-    /// codebase.
-    ///
-    /// We'll want to drive this list down by either:
-    /// 1. fixing violations of the rule and begin enforcing it
-    /// 2. deciding we want to allow the rule permanently, at which point
-    ///    we should codify that separately in this task.
-    ///
-    /// This list shouldn't be added to; it should only get shorter.
-    const MIGRATORY_RULES_TO_ALLOW: &[&str] = &[
-        // There are a bunch of rules currently failing in the `style` group, so
-        // allow all of those, for now.
-        "clippy::style",
-        // Individual rules that have violations in the codebase:
-        "clippy::almost_complete_range",
-        "clippy::arc_with_non_send_sync",
-        "clippy::await_holding_lock",
-        "clippy::borrow_deref_ref",
-        "clippy::borrowed_box",
-        "clippy::cast_abs_to_unsigned",
-        "clippy::cmp_owned",
-        "clippy::derive_ord_xor_partial_ord",
-        "clippy::eq_op",
-        "clippy::implied_bounds_in_impls",
-        "clippy::let_underscore_future",
-        "clippy::map_entry",
-        "clippy::never_loop",
-        "clippy::non_canonical_clone_impl",
-        "clippy::non_canonical_partial_ord_impl",
-        "clippy::reversed_empty_ranges",
-        "clippy::single_range_in_vec_init",
-        "clippy::suspicious_to_owned",
-        "clippy::type_complexity",
-        "clippy::unnecessary_to_owned",
-    ];
-
-    // When fixing violations automatically for a single package we don't care
-    // about the rules we're already violating, since it may be possible to
-    // have them fixed automatically.
-    let ignore_suppressed_rules = args.fix && args.package.is_some();
-    if !ignore_suppressed_rules {
-        for rule in MIGRATORY_RULES_TO_ALLOW {
-            clippy_command.args(["--allow", rule]);
-        }
-    }
-
-    // Deny `dbg!` and `todo!`s.
-    clippy_command
-        .args(["--deny", "clippy::dbg_macro"])
-        .args(["--deny", "clippy::todo"]);
-
     eprintln!(
         "running: {cargo} {}",
         clippy_command