Coraline Ada Ehmke has been writing software professionally since 1994. For the past decade, she’s been active in the Ruby programming language community and has created numerous open source tools to help fellow Ruby programmers.

But these days she's best known for a different type of code altogether. Ehmke is the original author of Contributor Covenant, a "code of conduct" for open source projects that encourages participants to use inclusive language and to refrain from personal attacks, harassment, or "other conduct which could reasonably be considered inappropriate in a professional setting."

Those might sound like common-sense rules, but Ehmke saw them as valuable after watching years of bad or questionable behavior by open source developers. For example, Linux creator Linus Torvalds has long had a reputation for profanity-laden rants, sometimes directed squarely at individual contributors to the open source operating system. When former Linux contributor Sage Sharp, then using a different name, suggested in 2013 that Torvalds was creating a toxic environment and recommended a code of conduct, Torvalds balked, telling WIRED "whole venting of frustrations and anger is actually necessary, and trying to come up with some 'code of conduct' that says that people should be 'respectful' and 'polite' is just so much crap and bullshit."

The combative nature of open source has often been blamed for its community's lack of diversity, which comes in even lower than the tech industry as a whole, according to research published last year by the code hosting and collaboration company GitHub. That survey found that 95 percent of open source developers are men.

Ehmke wants to help change that. "One of the things that motivates me is tech completely transformed my life," she explains. "I grew up in a town of 500 people in rural Virginia. I didn't have a lot of prospects. Tech has brought me great success and given me a lot of opportunity."

Codes of conduct are designed to make open source projects more inviting to everyone, and the idea is catching on. Today, more than 40,000 projects have adopted the Contributor Covenant, including Google's artificial intelligence platform TensorFlow and the increasingly popular programming framework Vue. Even Linux is finally on board: Earlier this month the project adopted the Contributor Covenant, and Torvalds apologized for his past behavior.

André Arko, lead maintainter of the popular Ruby tool Bundler, says the Contributor Covenant has changed the project for the better. Before the project adopted the Covenant, the team struggled to find enough contributors to maintain the project. That changed quickly. "We've had dramatically more participation," he adds. That’s meant more participation from women, minorities, and other underrepresented groups, but also more contributions from white men as well.

Ehmke wrote the first draft of the Contributor Covenant in 2014. At the time, there was a growing movement to pressure more tech conferences to adopt codes of conduct, after years of reported incidents of sexualized language in talks, as well as harassment and assault at events. But applying the idea to open source projects, which can involve hundreds of developers scattered around the world, was practically unheard of. Unlike corporate software projects, there’s no human resources department in an open source project to police behavior. "My thinking at the time was that we needed rules and structures not just for when people are physically present, but when virtually present as well," Ehmke says.

The first open source project to adopt the Contributor Covenant was the the Contributor Covenant itself, which Ehmke structured as an open source project. Just like open source software, any company or project can use the Contributor Covenant. People can contribute suggestions through the code collaboration site GitHub. Since the initial version, participants have added examples of positive behavior, such as being respectful and accepting constructive criticism gracefully, so that the code is not simply a laundry list of prohibitions.