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
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")
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.
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.
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
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.
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`.
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.
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.
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.
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
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.
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.
This introduces a monad transformer stack to cover our reader (options
from the CLI) and except (for handling failure cases, initially missing
tags or invalid config).
This ensures errors are bubbled up appropriately (and halt program
execution) and the Options are available in the correct locations within
the app.
This also separates options parsing (which remains in app/Main.) from
translating those options into the correctly executed runner and
generated output.