Go to file
Joshua Clayton 8d5e13c89e Use sensible defaults for the CLI
Why?
====

By default, people want to see an actionable, comprehensive list without
having to pass any flags into the program.

Previously, to see everything with high likelihood you'd need to provide
`-a --likelihood high`. This commit changes the program so that's the default.

It also introduces a `--all-likelihoods` flag (shorthand is `-a`) to see
everything, so if you want to opt into see it, you can. Finally, this
changes `-a` (to see everything) to `-s` (to see only single
occurrences, which was the previous default).
2016-05-11 11:31:52 -04:00
app Use sensible defaults for the CLI 2016-05-11 11:31:52 -04:00
src/Unused Use sensible defaults for the CLI 2016-05-11 11:31:52 -04:00
test Improve likelihood calculation and include reasons for evaluation 2016-05-11 05:18:55 -04:00
.gitignore Ignore tmp 2016-05-01 05:25:50 -04:00
LICENSE Initial 2016-04-28 05:37:06 -04:00
README.md Use sensible defaults for the CLI 2016-05-11 11:31:52 -04:00
Setup.hs Initial 2016-04-28 05:37:06 -04:00
stack.yaml Initial 2016-04-28 05:37:06 -04:00
unused.cabal Warn on everything, error on anything 2016-05-11 05:32:42 -04:00

Unused

A command line tool in Haskell to identify unused code.

Image of Unused Output

Using Unused

unused reads from a pipe expecting a series of tokens to search the codebase for.

This could be done with echo:

echo "module\nimport" | unused

Or pulling in a ctags file:

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:

stack install

This will generate a binary in $HOME/.local/bin; ensure this directory is in your $PATH.

Testing

To run the test suite, run:

stack test

License

Copyright 2016 Josh Clayton. See the LICENSE.