Commit Graph

188 Commits

Author SHA1 Message Date
Joshua Clayton
9300a1bc60
Configure default extensions (namely, OverloadedStrings) 2017-01-23 18:23:00 -05:00
Joshua Clayton
eddea2d65e
Bump version to 0.7.0.0 2017-01-12 08:38:00 -05:00
Joshua Clayton
8a16494a64
Update version dependencies for various packages
* Update the inflections package
* Better lock down megaparsec and cassava
2017-01-12 06:34:27 -05:00
Benjamin
9248aa929d
Support Docker builds 2016-11-12 06:19:16 -05:00
Josh Clayton
ab06b67ace Add information about download times to README (#79)
closes #78
2016-11-05 06:57:32 -04:00
Darlene Medeiros
0bf2e1d307 Fix markdown link (#75)
The comment about hasktags, between parentheses, was being interpreted as Exuberant Ctags link.
2016-09-18 15:00:34 -04:00
Joshua Clayton
3c3e479e45
Remove columns displaying occurrence/file count
These columns were not well-explained and, with limited space for
headers, often led to confusion.

This removes the columns. The data is still displayed in the more
verbose output (currently visible when seeing corresponding commit SHAs,
via the `--commits #` flag).

Closes #60
2016-08-31 06:56:42 -04:00
Joshua Clayton
7d9c923bd1
Bump version to 0.6.1.1 2016-08-30 06:33:40 -04:00
Joshua Clayton
80aa7aa950
Ensure data/config.yml is distributed with the package
This resolves an issue where data/config.yml is unavailable with an
error similar to:

    /private/tmp/stack66398/unused-0.6.1.0/src/Unused/ResultsClassifier/Config.hs:22:23:
        Exception when trying to run compile-time code:
          data/config.yml: openBinaryFile: does not exist (No such file or directory)
        Code: FE.embedFile "data/config.yml"
        In the splice: $(FE.embedFile "data/config.yml")
2016-08-30 06:31:09 -04:00
Joe Grossberg
107d1507bf
more newbie- and intermediate-friendly instructions
Outline ctags usage for developers familiar and unfamiliar with the tool

This introduces a new section to "Troubleshooting" outlining ctags
usage, as well as discussing the merits of a repeatable workflow for git
users.
2016-08-30 06:24:04 -04:00
Joshua Clayton
d81f32476d
Bump version to 0.6.1.0 2016-08-20 05:30:11 -04:00
Joshua Clayton
9cad495eb2
Conditionally import Data.Monoid.<> depending on version of base
Fixes #64
2016-08-20 05:22:51 -04:00
Joshua Clayton
fde9f69a64
Replace Cabal-managed config loading with FileEmbed
This uses the file-embed package and TemplateHaskell to load custom
configuration during compilation instead of loading it at runtime.
2016-08-18 17:59:12 -04:00
Sean Collins
8b50f5dd68
Add note about generating tags file 2016-08-18 04:45:04 -04:00
Joshua Clayton
77b887188d
Bump version to 0.6.0.1 2016-07-19 22:30:29 -04:00
Joshua Clayton
eda4991e38
Given issues with ParseError type, cast to String first
When installing 0.6.0.0 via Homebrew, a compilation error is shown:

    src/Unused/Projection.hs:27:34: error:
        • Expecting two more arguments to ‘ParseError’
          Expected a type, but ‘ParseError’ has kind ‘* -> * -> *’
        • In the first argument of ‘Either’, namely ‘ParseError’
          In the type signature:
            parseTransform :: Text -> Either ParseError ParsedTransform
    cabal: Leaving directory '.'
    cabal: Error: some packages failed to install:
    unused-0.6.0.0 failed during the building phase. The exception was:
    ExitFailure 1

Given we're rendering the output as a string with `show`, this moves
`show` to where we parse and pass the `String` around instead.
2016-07-19 22:25:56 -04:00
Joshua Clayton
7e3b91dc24
Bump version to 0.6.0.0 2016-07-19 16:27:25 -04:00
Joshua Clayton
060f1e3499
Fix naming and pattern-matching 2016-07-19 16:22:54 -04:00
Joshua Clayton
7fe32edc4d
Support projections-style transformations to reduce false-positives
Basic aliases (e.g. `admin?`/`be_admin`) can be represented easily with simple
wildcards, but more complex transformations require a different mechanism.

Instead of using `%s` to represent strings that can be replaced 1:1, this
introduces a syntax inspired by https://github.com/tpope/vim-projectionist, as
such:

    - name: Rails
      aliases:
      - from: "*Validator"
        to: "{snakecase}"

This would find `AbsoluteUriValidator` and also match `absolute_uri`, which
would be found if the validation was in use.

This currently supports the `camelcase` and `snakecase` transformations,
as well as no transformation.

Closes #18
2016-07-19 15:14:34 -04:00
Joshua Clayton
15cc48b0e4
Remove Show derivation from everything in Unused.ResultsClassifier.Types
The "deriving Show" on each of the data types is unnecessary
2016-07-19 05:16:50 -04:00
Guilherme Baptista
fe791e92d4
consider Total Score <2 as occurs once 2016-07-19 05:09:46 -04:00
Joshua Clayton
fe3122cac4
Improve alias calculations
Previously, aliases were calculated twice:

1. when building out the list of terms to search for
2. when merging results into TermResults for grouping (and likelihood calcs)

This problem was masked by the fact that wildcard matching on both ends
was the same, with '%s'. However, the goal is to move away from simple
'%s' matching and do a system where transformations can be applied to
the text, which would address #18.

This moves us one step closer to fixing that issue.
2016-07-16 05:19:42 -04:00
Joshua Clayton
f94bc55628
Cleanup in preparation for improved alias handling
This introduces a handful of minor refactors/abstractions
2016-07-15 21:50:44 -04:00
Joshua Clayton
c1492e8cb5
Discuss excluding paths in ctags 2016-07-06 06:44:44 -04:00
Joshua Clayton
c23f123ea6
Continue to update Haskell style
This commit:

* Qualifies a number of imports across the codebase
* Aligns imports
2016-07-06 04:59:49 -04:00
Joshua Clayton
7618e6cb23
Add Readable typeclass to simplify safe reading of files
Why?
====

After the introduction of:

    safeReadFile :: FilePath -> IO (Either E.IOException String)

There were places who needed to repack data into the appropriate type.
This is an extra step and, while in these situations not necessarily
*slow*, should be removed.

This introduces a Readable typeclass which dictates implementation of
`readFile'` based on the resulting requested type. This means `safeReadFile`
can be used in various situations without having to `pack`.
2016-07-03 06:08:03 -04:00
Joshua Clayton
752a3b23b9
Remove race conditions checking file existence before reading 2016-07-02 07:46:01 -04:00
Joshua Clayton
d9efa11777
More safely handle reading files
This replaces readIfFileExists, which has a race-condition and may raise
an exception, with safeReadFile, which safely reads a file and includes
the IOException if something goes wrong.
2016-07-02 07:08:09 -04:00
Joshua Clayton
e1d6143161
Emphasize developers need to ensure removing code won't break things
Unused is not a tool where you can remove code without verifying
behavior still works, since it's most valuable in dynamic languages like
Ruby, Elixir, JavaScript, etc.
2016-07-02 06:58:46 -04:00
Joshua Clayton
df64386552
Move around whitespace in description from help text 2016-07-02 06:57:29 -04:00
Joshua Clayton
40f0158f4d
Outline common troubleshooting scenarios
Common scenarios right now seem to be:

* Issues with the cache, and specifically find
* Seeing no results when results are expected

This discusses a few different reasons for those issues, and ideas of
how a developer might address them.
2016-07-01 06:35:35 -04:00
Joshua Clayton
2eeb54fe58
Haskell styles
This includes cosmetic changes to improve styles
2016-07-01 05:06:19 -04:00
Joshua Clayton
51f9ae7992
Combine readConfig and loadConfig 2016-06-27 06:11:39 -04:00
Joshua Clayton
8828f65cb7
Make reading files safer 2016-06-27 05:55:11 -04:00
Joshua Clayton
87d773c126
ask -> asks 2016-06-27 05:54:47 -04:00
Joshua Clayton
fa0a947ca8
Update docs around installation/upgrading 2016-06-26 05:13:28 -04:00
Joshua Clayton
8f424ea0e3
Outline installation via Stack
This documents now to install via Stack, by updating the list of known
packages, ensuring at least lts-6.0, and then installing unused
directly.
2016-06-24 09:22:06 -04:00
Joshua Clayton
b852cff74c
Bump version to 0.5.0.2 2016-06-24 08:31:44 -04:00
Joshua Clayton
94bbd04f6a
Remove final -Werror setting 2016-06-24 08:31:14 -04:00
Joshua Clayton
f0c24682e4
Bump version to 0.5.0.1 2016-06-24 08:30:13 -04:00
Joshua Clayton
121775cbc6
Remove -O flag entirely for Hackage upload 2016-06-24 08:29:32 -04:00
Joshua Clayton
b0f8d7f620
Bump version to 0.5.0.0 2016-06-24 08:27:20 -04:00
Joshua Clayton
5d6ec8d611
Remove -Werror from compilation
To upload to hackage, -Wall -Werror cannot both be set. This can be
achieved by installing with stack's `--pedantic` flag.
2016-06-24 08:17:55 -04:00
Joshua Clayton
11ff583d3c
Convert from -O2 to -O 2016-06-24 08:15:57 -04:00
Joshua Clayton
240b5bbb19 Support digesting on Linux with md5sum
This introduces behavior searching for an available program to calculate
digests across directories. OS X ships with md5, but on *nix-based
systems, it's md5sum. The output is largely the same, apart from the
final digest calculation, which includes a "file path":

    da52a1a5d5a3c9672371746e4d32708a  -

This strips the trailing whitespace and dash:

    da52a1a5d5a3c9672371746e4d32708a

Closes #49
2016-06-23 23:11:32 -04:00
Joshua Clayton
1892f8c0ba Extract error headers 2016-06-23 22:44:23 -04:00
Joshua Clayton
b65de02efc Display recent git SHAs per token
This creates a new "list" output format that includes a certain number
of git SHAs per token. This allows for perusal of the most recent
changes for a given token to understand what changed.
2016-06-21 23:02:37 -04:00
Joshua Clayton
ce9b3b8a13 Store computed aliases on TermResults 2016-06-21 06:12:40 -04:00
Joshua Clayton
a6e926e4d2 Move thread management to app wrapper
Why?
====

With multiple calls to `parallel`, `stopGlobalPool` stops working
correctly.

This moves `stopGlobalPool` higher up, and executes it once, allowing
multiple calls to `parallel` to happen without causing issues.
2016-06-21 06:10:18 -04:00
Joshua Clayton
a5b8f31e4d Use internal CacheFileName newtype for referencing where the cache lives 2016-06-16 07:04:37 -04:00