2016-04-28 12:37:06 +03:00
|
|
|
# Unused
|
|
|
|
|
|
|
|
A command line tool in Haskell to identify unused code.
|
|
|
|
|
2016-05-11 00:24:28 +03:00
|
|
|
![Image of Unused Output](http://i.giphy.com/l39707ITHLsymwSiI.gif)
|
|
|
|
|
2016-04-29 12:55:09 +03:00
|
|
|
## Using Unused
|
|
|
|
|
|
|
|
`unused` reads from a pipe expecting a series of tokens to search the codebase
|
|
|
|
for.
|
|
|
|
|
|
|
|
This could be done with `echo`:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
echo "module\nimport" | unused
|
|
|
|
```
|
|
|
|
|
|
|
|
Or pulling in a ctags file:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
cat .git/tags | cut -f1 | sort -u | unused
|
|
|
|
```
|
|
|
|
|
|
|
|
My end goal is to have the latter rolled up into unused itself, so you can
|
|
|
|
navigate to a directory, run `unused`, and everything works as expected.
|
|
|
|
|
|
|
|
## Building and Compiling
|
|
|
|
|
|
|
|
This project uses Haskell and Stack.
|
|
|
|
|
|
|
|
Once you have these tools installed:
|
|
|
|
|
|
|
|
```sh
|
2016-05-01 11:48:35 +03:00
|
|
|
stack install
|
2016-04-29 12:55:09 +03:00
|
|
|
```
|
|
|
|
|
2016-05-01 11:48:35 +03:00
|
|
|
This will generate a binary in `$HOME/.local/bin`; ensure this directory is in
|
|
|
|
your `$PATH`.
|
2016-04-29 12:55:09 +03:00
|
|
|
|
2016-04-28 12:37:06 +03:00
|
|
|
## License
|
|
|
|
|
|
|
|
Copyright 2016 Josh Clayton. See the [LICENSE](LICENSE).
|