Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changelog/remove-deprecated-forge-generate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
forge: major
---

Removed the deprecated `forge generate` command.
13 changes: 0 additions & 13 deletions crates/forge/assets/generated/TestTemplate.t.sol

This file was deleted.

5 changes: 1 addition & 4 deletions crates/forge/src/args.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{
cmd::{cache::CacheSubcommands, generate::GenerateSubcommands, watch},
cmd::{cache::CacheSubcommands, watch},
opts::{Forge, ForgeSubcommand},
};
use clap::{CommandFactory, Parser};
Expand Down Expand Up @@ -139,9 +139,6 @@ pub fn run_command(args: Forge) -> Result<()> {
}
}
ForgeSubcommand::Selectors { command } => global.block_on(command.run()),
ForgeSubcommand::Generate(cmd) => match cmd.sub {
GenerateSubcommands::Test(cmd) => cmd.run(),
},
ForgeSubcommand::Compiler(cmd) => cmd.run(),
ForgeSubcommand::Soldeer(cmd) => global.block_on(cmd.run()),
ForgeSubcommand::Eip712(cmd) => cmd.run(),
Expand Down
72 changes: 0 additions & 72 deletions crates/forge/src/cmd/generate/mod.rs

This file was deleted.

1 change: 0 additions & 1 deletion crates/forge/src/cmd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ pub mod flatten;
pub mod fmt;
pub mod fuzz;
pub mod geiger;
pub mod generate;
pub mod init;
pub mod inspect;
pub mod install;
Expand Down
6 changes: 1 addition & 5 deletions crates/forge/src/opts.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::cmd::{
bind::BindArgs, bind_json, build::BuildArgs, cache::CacheArgs, clone::CloneArgs,
compiler::CompilerArgs, config, coverage, create::CreateArgs, doc::DocArgs, eip712, flatten,
fmt::FmtArgs, fuzz::FuzzArgs, geiger, generate, init::InitArgs, inspect, install::InstallArgs,
fmt::FmtArgs, fuzz::FuzzArgs, geiger, init::InitArgs, inspect, install::InstallArgs,
lint::LintArgs, remappings::RemappingArgs, remove::RemoveArgs, selectors::SelectorsSubcommands,
snapshot, soldeer, test, tree, update,
};
Expand Down Expand Up @@ -220,10 +220,6 @@ pub enum ForgeSubcommand {
command: SelectorsSubcommands,
},

/// Generate scaffold files.
#[command(hide = true)]
Generate(generate::GenerateArgs),

/// Compiler utilities.
Compiler(CompilerArgs),

Expand Down
15 changes: 0 additions & 15 deletions crates/forge/tests/cli/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4764,21 +4764,6 @@ Flattened file written at [..]flat.sol
assert!(out.exists(), "flattened file should have been written");
});

// `forge generate test` writes the scaffolded file and emits its status string to stderr,
// keeping stdout empty so agents can pipe the command without diagnostics.
forgetest!(generate_test_writes_status_to_stderr, |prj, cmd| {
cmd.args(["generate", "test", "--contract-name", "Counter"])
.assert_success()
.stdout_eq(str![""])
.stderr_eq(str![[r#"
Warning: `forge generate` is deprecated and will be removed in a future version
Generated test file: test/Counter.t.sol

"#]]);

assert!(prj.root().join("test/Counter.t.sol").exists(), "scaffolded test file should exist");
});

// `forge init` writes its status prose to stderr and keeps stdout empty so agents
// can pipe the command without diagnostics. Uses `--offline` + `--no-git` to skip
// network and git side-effects that would otherwise add prose to stdout.
Expand Down
1 change: 0 additions & 1 deletion docs/dev/output-channels.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ Each row's status is one of:
| `forge clean` | (empty) | n/a | migrated |
| `forge completions` | Generated shell completion script | n/a | migrated |
| `forge doc` | (empty) | n/a | migrated |
| `forge generate` | (empty) or generated path | n/a | migrated |
| `forge soldeer` | Passthrough to `soldeer` crate; foundry adds no wrapper prose | n/a | migrated |
| `forge remappings` | One remapping per line | n/a | migrated |
| `forge compiler` | Compiler info | JSON | migrated |
Expand Down
Loading