DEV Community

Cover image for Making it easier to contribute to Open Source
Antonio-Bennett
Antonio-Bennett

Posted on • Edited on

3 2

Making it easier to contribute to Open Source

Hello everyone! So this week in my class we had to configure our static site generators to be easier to contribute to. This included adding a CONTRIBUTING.md file and also default format styles etc.

STEP 1

The first thing I did was creating a rustfmt.toml file for default format styles. Rust makes it super easy so all I had was this file which is used via cargo fmt

max_width = 120
comment_width = 100
match_block_trailing_comma = true
Enter fullscreen mode Exit fullscreen mode

STEP 2

I also created a clippy.toml file however it is blank since the defaults for clippy are pretty sane already and I have no need to modify it. I still created the file however to signify that we do use cargo clippy to lint our files.

Step 3

I then created a .vscode folder with a settings.json file that held only 1 line. Which is to format on save for vscode users. (I use neovim). Hopefully I did that correctly...

{ "editor.formatOnSave": true }
Enter fullscreen mode Exit fullscreen mode

Step 4

I then finally bundled the information into the CONTRIBUTING.md file and linked it in my README.md. The commit can be found here

Final Thoughts

This lab made me really appreciate rust's first class support for in built tools to format and lint code easily. It is easily configurable and makes it easy for everyone to collaborate together hassle free.

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

Top comments (0)

Eliminate Context Switching and Maximize Productivity

Pieces.app

Pieces Copilot is your personalized workflow assistant, working alongside your favorite apps. Ask questions about entire repositories, generate contextualized code, save and reuse useful snippets, and streamline your development process.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay