Skip to content
Draft
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Passing a cheatcode span of 0 was incorrectly treated as `CheatSpan::Indefinite`. This is now resolved by making `CheatSpan::TargetCalls` accept `NonZero<usize>` instead of just `usize` in `snforge_std`.

#### Removed

- The deprecated command `snforge init`. Use `snforge new` to initialize new `Forge` projects

### Cast

#### Added
Expand Down
24 changes: 0 additions & 24 deletions crates/forge/src/init.rs

This file was deleted.

10 changes: 0 additions & 10 deletions crates/forge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ pub mod block_number_map;
mod clean;
mod combine_configs;
mod compatibility_check;
mod init;
mod new;
pub mod run_tests;
pub mod scarb;
Expand Down Expand Up @@ -89,11 +88,6 @@ enum ForgeSubcommand {
#[command(flatten)]
args: TestArgs,
},
/// Create a new directory with a Forge project
Init {
/// Name of a new project
name: String,
},
/// Create a new Forge project at <PATH>
New {
#[command(flatten)]
Expand Down Expand Up @@ -272,10 +266,6 @@ pub fn main_execution(ui: Arc<UI>) -> Result<ExitStatus> {
let cli = Cli::parse();

match cli.subcommand {
ForgeSubcommand::Init { name } => {
init::init(name.as_str(), &ui)?;
Ok(ExitStatus::Success)
}
ForgeSubcommand::New { args } => {
new::new(args)?;
Ok(ExitStatus::Success)
Expand Down
22 changes: 0 additions & 22 deletions crates/forge/tests/e2e/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,6 @@ use toml_edit::{DocumentMut, Formatted, InlineTable, Item, Value};

static RE_NEWLINES: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"\n{3,}").unwrap());

#[test]
fn init_new_project() {
let temp = tempdir_with_tool_versions().unwrap();

let output = runner(&temp)
.args(["init", "test_name"])
.env("DEV_DISABLE_SNFORGE_STD_DEPENDENCY", "true")
.assert()
.success();

assert_stdout_contains(
output,
indoc!(
r"
[WARNING] Command `snforge init` is deprecated and will be removed in the future. Please use `snforge new` instead.
"
),
);

validate_init(&temp.join("test_name"), false, &Template::BalanceContract);
}

#[test_case(&Template::CairoProgram; "cairo-program")]
#[test_case(&Template::BalanceContract; "balance-contract")]
#[test_case(&Template::Erc20Contract; "erc20-contract")]
Expand Down
1 change: 0 additions & 1 deletion docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@

* [`snforge` Commands](appendix/snforge.md)
* [test](appendix/snforge/test.md)
* [init](appendix/snforge/init.md)
* [new](appendix/snforge/new.md)
* [clean](appendix/snforge/clean.md)
* [clean-cache](appendix/snforge/clean-cache.md)
Expand Down
1 change: 0 additions & 1 deletion docs/src/appendix/snforge.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# `snforge` CLI Reference

* [`snforge test`](./snforge/test.md)
* [`snforge init`](./snforge/init.md)
* [`snforge new`](./snforge/new.md)
* [`snforge clean`](./snforge/clean.md)
* [`snforge clean-cache`](./snforge/clean-cache.md)
Expand Down
15 changes: 0 additions & 15 deletions docs/src/appendix/snforge/init.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/src/testing/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ To run all tests regardless of the `#[ignore]` attribute use `snforge test --inc
In order to use it, your project must have the `assert_macros` dependency added to the `Scarb.toml` file.
These macros are very expensive to run on Starknet, as they result a huge amount of steps and are not recommended for production use.
They are only meant to be used in tests.
For snforge `v0.31.0` and later, this dependency is added automatically when creating a project using `snforge init`. But for earlier versions, you need to add it manually.
For snforge `v0.31.0` and later, this dependency is added automatically when creating a project using `snforge new`. But for earlier versions, you need to add it manually.

```toml
[dev-dependencies]
Expand Down
Loading