Commit Graph

74 Commits

Author SHA1 Message Date
Joshua Clayton
4097ac4aa8 Bump version to 0.1.1.0 2016-05-12 18:11:14 -04:00
Joshua Clayton
7f0e701823 Extract internal parsing handling to separate module
Why?
====

Parsing lines of results was somewhat unreliable, and terms with odd
characters were causing problems. This:

* extracts parsing into an Unused.Parser.Internal module for ease of
  testing
* fixes cases where certain tokens weren't matching
2016-05-12 18:02:59 -04:00
Joshua Clayton
cf542044df Warn on everything, error on anything 2016-05-11 05:32:42 -04:00
Joshua Clayton
86146ad4a4 Update cabal file to reflect proper information 2016-05-11 05:28:01 -04:00
Joshua Clayton
2650e1f040 Improve likelihood calculation and include reasons for evaluation
Why?
====

A simple calculation ("yes, this should be removed" or "no, this is
probably fine") is frankly not enough information for someone evaluating
their codebase to understand why we made the decision.

This introduces a removal reason, so a user understands why we ranked it
the way we did, and adds additional logic around a method and its tests
to determine if a method exists and is only being used in the tests (if
so, it should probably be deleted).

This is done with an Occurrances record, which is created for total
files, test code, and non-test code. The test code logic is somewhat
naive but works in most cases. It doesn't ensure a particular directory,
in the case that tests live alongside source code (e.g. Go), and
captures RSpec cases as well.
2016-05-11 05:18:55 -04:00
Joshua Clayton
4947e54f27 Better manage column formatting
Why?
====

Formatting each column requires context on the column, as well as
information on alignment. This extracts the column formatting logic to a
specific formatter.

ColumnFormatter is coupled to the order of columns/data displayed to the
user.
2016-05-10 06:37:31 -04:00
Joshua Clayton
11d35a6263 Hook into interrupt to trigger other behavior
Why?
====

Unused hides the cursor and potentially does other things to the window that
may leave it in an odd state. This introduces a hook to run any state
cleanup, including re-enabling the cursor, when a user sends a SIGINT to
the program.
2016-05-10 05:35:28 -04:00
Joshua Clayton
5952306873 Run optimizations 2016-05-09 08:29:09 -04:00
Joshua Clayton
f7a2e1a287 Add Hspec and tests around parsing 2016-05-08 06:54:34 -04:00
Joshua Clayton
bfca8cae19 Error on warnings 2016-05-07 06:23:38 -04:00
Joshua Clayton
53bd914fd9 Remove unnecessary dependency on mtl 2016-05-07 06:10:19 -04:00
Joshua Clayton
1f5db58f5e Move additional functionality out of Types and into separate modules 2016-05-07 06:10:15 -04:00
Joshua Clayton
a924cb99f3 Extract ProgressBar to have a similar interface to Spinner 2016-05-06 21:43:22 -04:00
Joshua Clayton
0f4e056641 Introduce a Spinner when no progress bar is displayed
Why?
====

With a spinner in place, there's visual indication that something's
happening.
2016-05-06 17:25:20 -04:00
Joshua Clayton
e34f6951f1 Add optparse-applicative for flags
This introduces the optparse-applicative library for parsing out any
subcommands/flags/args. Currently only supports --no-progress (-P).
2016-05-05 17:53:53 -04:00
Joshua Clayton
67e52ed017 Initial pass at RemovalLikelihood calculator 2016-05-03 21:41:03 -04:00
Joshua Clayton
49b7b65b17 Improve output by grouping by directory structure 2016-05-03 05:22:50 -04:00
Joshua Clayton
3ddf0631a9 Display progress bar when running ag 2016-05-02 06:05:31 -04:00
Joshua Clayton
9f006ffd3c Filter results to matches with one file and one occurrence 2016-04-30 05:49:04 -04:00
Joshua Clayton
2d4939cb47 Reorganize data structure to handle parsing errors
This extracts the previous data structure from groupBy into an actual
Data.Map.Strict String [TermMatch], as well as another type
(ParseResponse) capturing invalid and valid responses.
2016-04-29 05:28:03 -04:00
Joshua Clayton
ed72d2405a Initial pass at adding color to output 2016-04-29 04:46:31 -04:00
Joshua Clayton
a5230f163e Parse results into matches 2016-04-28 22:21:18 -04:00
Joshua Clayton
1249a0e823 Search for terms from a tags file
This returns a list of each match, files, and counts based on the
current directory.
2016-04-28 17:42:58 -04:00
Joshua Clayton
8931c08f93 Initial 2016-04-28 05:37:06 -04:00