DEV Community

Ash Freels
Ash Freels

Posted on

Why you should have a code of conduct on GitHub

I made the decision to add a code of conduct to my current and future repos on GitHub. Based on my personal experiences I made my choice when I asked these questions:

  • What is the purpose of a code of conduct?
  • How can I prevent negative behavior in the future?
  • What enforcement will take place for rule violations?

The purpose of writing this article is to advocate creating a safe space and a welcoming environment in the open source community. As developers we should respect one another and this includes contributing to open source projects.

A few bad apples make it bad for everyone

Any good open source project will have a detailed README.md and a CONTRIBUTING.md in the repo. It is important to create a positive environment for contributors. However, negative and toxic behavior can push contributors away from a project.

Git commits and documentation are not for harassment

Commits and proper documentation are used to document changes in a project. The purpose is not to bully or harass individuals who made a mistake. This can deter contributors to contribute for another project. Examples of a toxic open source environment was calling out people's first name in the commits, putting down contributors, taking credit and not acknowledging the work of others. I have been on the receiving end and the outcome was not pretty.

A code of conduct is needed

If you want multiple contributors to your open source project having clear guidelines for contributors is essential. Adding a code of conduct on my part was to make my projects welcome to anyone who wants to contribute. You can choose to adopt a code of conduct that reflects your community standards.

Final thoughts

Code of Conducts are meant to create an inclusive environment. Having one creates boundaries for open source projects and makes sure everyone follows the guidelines when contributing. Encouraging participation in the community and creating a harassment free environment makes contributors feel welcome. I would welcome any contributions to a project.

Resources

Adding a code of conduct in GitHub

Your Code of Conduct

Example of Code of Conduct

Discussion (0)