A command line tool to quickly lookup code owners of classes, methods and more.
Starting to work on a larger software project is often intimidating. Who Wrote That makes it easy to find a person of contact that owns a specific declaration within a file. Depending on the programming language a declaration may be a function, method, class or interface declaration.
Who Wrote That works with Git repositories. It uses Tree-sitter parsers to build Abstract Syntax Trees of code written in a multitude of different programming languages.
To use Who Wrote That with your directory or file, it must be or be located within a Git repository and it must use one of the supported programming languages.
You can install Who Wrote That globally with Yarn
$ yarn global add who-wrote-that
or NPM
$ npm install -g who-wrote-that
wwt decl <file> <definition>
Lookup code owners of a given declaration inside a file.
wwt line <file> <lineNumber>
Lookup code owners of a declaration on a given line of a file.
wwt file <file>
Lookup code owners of a given file.
| Option | Description |
|---|---|
-d --depth <number> |
The maxmium recursive depth of the code owner algorithm (e.g. the number of commits to look back in history). Takes a positive number. Defaults to undefined -- unlimited recursive depth. |
-f --format <format> |
Output format. Allowed values are pretty, data, and json. Defaults to pretty. |
-s --strategy <strategy> |
Strategy used for the code owner algorithm. Allowed values are weighted-lines, and lines. Defaults to weighted-lines. |
-v --version |
Outputs the version number |
-h --help |
Outputs usage information |
- Go
- Java
- JavaScript
- Python
- TypeScript
To add support for a new language
- create a language file in
src/languages; - and import the language file in
src/languages/index.ts.
Listen to changes and make them accessible through wwt from the command line:
$ yarn start
Run ESLint:
$ yarn eslint
Run TypeScript compiler checks:
$ yarn tsc
Run tests:
$ yarn test
- Change the version in
package.jsonandsrc/index.ts. - Create a pull request to merge the changes into
master. - After the pull request was merged, create a new release listing the breaking changes and commits on
mastersince the last release. - The release workflow will publish the package to NPM.