✊ woke - Check for insensitive language in your source code
Tags: inclusion, go, opensource
Published: 2020-10-12 16:34:54

## Adopting Inclusive Language in Tech

It's 2020 and it seems the tech industry is finally coming to terms with the outdated, racially insensitive language that has become ubiquitous in our day-to-day lives. 

It's incredible to see real action on this front happening. 
Companies like [GitHub](https://github.com/github/renaming), [Apple](https://developer.apple.com/news/?id=1o9zxsxl), and [Twitter](https://twitter.com/TwitterEng/status/1278733303508418560), to name a few, have already committed and have began rolling out changes to remove insensitive language and replace it with more inclusive alternatives.

Terms like `master`/`slave` that are common when describing database architecture, being replaced by `primary`/`secondary`, or `whitelist`/`blacklist` to describe access patterns, being replaced with non-color alternatives such as `allowlist`/`denylist`.

When I saw all of this, I was inspired! And when my colleague, Fabiana Scala, brought up the subject adopting conscious language within codebases and conversations, I started researching ways to help developers maintain a commitment to building inclusive code. When I came up short, I decided to build a tool myself, and to build it as an open source project.

## Words Matter

Check out my post on Rent the Runway's tech blog on why this is important to me, personally, as well as Engineering at RTR: https://dresscode.renttherunway.com/blog/woke.

## Introducing woke 

{% github get-woke/woke no-readme %}

`woke` is the tool that I created that will detect non-inclusive language in your source code. It is an open source project, and [contributions](https://github.com/get-woke/woke/blob/main/CONTRIBUTING.md) are [welcome](https://github.com/get-woke/woke/blob/main/CODE_OF_CONDUCT.md)!

![woke demo](https://dev-to-uploads.s3.amazonaws.com/i/helr0r1a1vqhajj5t036.gif)

## What is it?

`woke` is a text file analyzer. It searched through lines of text and matches it against a set of rules to find insensitive words, then suggests inclusive alternatives.

### Features

`woke` is quite similar to the linters we use on a regular basis.

* Built-in default set of rules.
* You can define your own rules, or disable default rules, via a config file, which can be committed to your repos for use in CI pipelines.
* You can define files that should always be ignored (ie pre-compile assets or package-log.json), or ignore specific lines within files with a comment.
* You can either run `woke` against an entire directory or specific files. This can be something like `**/*.go`, or a space-separated list of filenames or directories.
* You can also have `woke` read from `stdin`
* If `woke` finds any violations, it will output them in different formats and will return with an exit code of 0. If you want it to return with exit code 1, you can. 
* This is useful when running as a Pull/Merge Request check, where you want to let the author know there are violations, but you might not want to block the code from being merged.

## Using woke

There are currently two officially-supported integrations (via GitHub Actions):
* https://github.com/marketplace/actions/run-woke
* https://github.com/marketplace/actions/run-woke-with-reviewdog

Since `woke` is compiled to a static binary, other integrations can easily be built! For example, `woke` can be run as a VSCode extension or Atom package, a Jenkins plugin, used in any other CI platform, like GitLab, CircleCI, TravisCI, you name it! If it can run a static binary, it can run `woke`. And your code will be more inclusive because of it!

## Now what?

Now what? Start running `woke` against all your source code! Add it to your open source projects to show potential contributors that you care about inclusivity! Convince your leadership to integrate woke within your organization! While it may seem like a small step, it has the potential to make a huge long-term impact to build and maintain an inclusive culture.

Don't forget to become a stargazer or watch the repo!

## Resources

Some excellent articles that go more in-depth about the importance of inclusive language in tech.
* https://medium.com/pm101/inclusive-language-guide-for-tech-companies-and-startups-f5b254d4a5b7
* https://buffer.com/resources/inclusive-language-tech/
* https://www.marketplace.org/2020/06/17/tech-companies-update-language-to-avoid-offensive-terms/

{% github get-woke/woke %}