foundry-rs / starknet-foundry

Blazing fast toolkit for developing Starknet contracts.
https://foundry-rs.github.io/starknet-foundry/
MIT License
322 stars 168 forks source link

Add specific directories to `.gitignore` when calling `snforge init` #2298

Open piotmag769 opened 3 months ago

piotmag769 commented 3 months ago

Which components does the task require to be changed? (think hard pls)

snforge

Description

When calling snforge init <project> there is a .gitignore file created, that states what files should be omitted by the vcs. It is, however, not complete as it omits a few files that snforge is able to create during its runs, which may result in accidental inclusion of this files by git.

We should modify the snforge init code, so it includes these files in the .gitignore file:

Proposed steps:

Definition of done:

JoE11-y commented 3 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I'm Joseph a blockchain developer with over four years in blockchain and backend development, I’ve worked across different ecosystems, handling everything from smart contract design to on-chain interactions and protocol integration. I focus on building secure, scalable, and reliable blockchain applications, managing both on-chain and off-chain infrastructure.

How I plan on tackling this issue

Begin by studying the codebase to ensure design consistency, then proceed to work on the task.

  1. Study current codebase design
  2. Identify parts of code that needs to be changed
  3. Make necessary changes
  4. Add tests to make sure the changes are working and no adverse effects
  5. And lastly optimize
CollinsC1O commented 3 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello I'm a front-end and a blockchain developer. I will love to work on this

ikemHood commented 3 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello @piotmag769, I would love to do this

How I plan on tackling this issue

in starknet-foundry/crates/forge/src/init.rs

update

fn extend_gitignore(path: &Path) -> Result<()> {
    let mut file = OpenOptions::new()
        .append(true)
        .open(path.join(".gitignore"))?;
    writeln!(file, ".snfoundry_cache/")?;

    Ok(())
}

add new files|directories to be ignored

0xNeshi commented 3 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Rust experience and a regular Foundry user for Starknet smart contract testing. Regular "Cairo Book" and "Starknet By Examle" contributor. Creator and maintainer of Cairo learning track on Exercism. As a regular Foundry user, I'm very interested in making it as efficient and as clean as possible.

How I plan on tackling this issue

I would update the extend_gitignore function to append the files from the description. https://github.com/foundry-rs/starknet-foundry/blob/12d2bd4b852d576f545d3876b6f49349db2f122a/crates/forge/src/init.rs#L140

Update the relevant test to assert these new files were actually created; this would also require validating that .gitignore was actually created in the first place. https://github.com/foundry-rs/starknet-foundry/blob/12d2bd4b852d576f545d3876b6f49349db2f122a/crates/forge/tests/e2e/running.rs#L727

Akshola00 commented 3 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I have a strong background in full-stack and blockchain development, including experience with Git and managing project setups. I’ve worked with tools that create project files and automate configurations, which helped me understand how .gitignore files prevent unwanted files from being added to version control.

How I plan on tackling this issue

I will review the snforge init code to see how the .gitignore file is created and which files are excluded. I will modify the code to add snfoundry_trace, .snfoundry_cache, .snfoundry_versioned_programs, and coverage. After these changes, I’ll set up tests to ensure the updated .gitignore file is created correctly when running snforge init . Finally, I’ll run these tests in different environments to confirm that everything works as expected. This process will ensure a complete .gitignore file is generated consistently.

DanielEmmanuel1 commented 3 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello again, my name is Deon,I am a Full-Stack web3 developer passionate about building with Rust. I have had prior experience building web3 applications/smart contracts with rust as well as creating high-performance backends.

I have a solid understanding of both backend development and data management. As an open source contributor to numerous projects, I’m committed to writing clean, maintainable code.

How I plan on tackling this issue

I believe using these above steps will enable me to enhance the snforge initialization process, preventing accidental inclusion of specific files and improving project organization.

Once again, I’m ecstatic about the opportunity of contributing to the Foundry project and can’t wait to get started, Do have a great day.

khayss commented 3 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I’m a Rust developer with experience in managing project setups and ensuring smooth version control workflows. I’ve worked on projects where improving .gitignore configurations to avoid unnecessary file commits was crucial. My experience with Rust and familiarity with git make me a good fit for this issue.

How I plan on tackling this issue

To ensure that the .gitignore file created by snforge init includes the necessary files, I will:

  1. Identify the relevant part of the snforge init code that generates the .gitignore file.
  2. Modify this part of the code to include the specified directories and files:
    • snfoundry_trace
    • .snfoundry_cache
    • .snfoundry_versioned_programs
    • coverage
  3. Ensure the updated .gitignore file is automatically generated when initializing a new project with snforge init <project>.
  4. Write and run end-to-end (e2e) tests to verify that the .gitignore file contains the correct entries after snforge init is called.
  5. Confirm that no unintended files are included in the version control system, improving the project's default setup.

I would love the opportunity to work on this issue and enhance the snforge init setup.

juandiegocv27 commented 3 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I’m Juan Diego, a software engineer currently working on ByteBeasts, an on-chain RPG game, and a member of the Dojo Coding community. I have strong experience with Rust, which I’ve been using extensively, and I’m also learning Cairo. I’ve contributed to various open-source projects, including work on full-stack development and blockchain solutions. I’m comfortable with project setup and automation tasks, especially managing project structures and improving workflows like .gitignore configurations. I’m confident that my experience will allow me to contribute effectively to this task.

How I plan on tackling this issue

ETA: 2-3 days

mexes20 commented 3 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello, can I be assigned to work on this issue?

I'm a software developer with over 6 years experience

ETA: One day

raizo07 commented 3 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello, can I be assigned to work on this issue?

I'm a software developer with over 4 years experience

Here's my OnlyDust profile https://app.onlydust.com/u/raizo07

ETA: One day

THenry14 commented 2 days ago

Hi @Akshola00 , hope everything's going well. Just wanted to touch base and ask if you have any updates on this? thanks

Akshola00 commented 2 days ago

Hi @THenry14 Finished adding specific directories and now doing end to end testing