Commit Graph

205 Commits

Author SHA1 Message Date
Joshua Clayton
9b1f3be11d
Deprecate this version of Unused
What?
=====

The new version of Unused lives at https://github.com/unused-code/unused

All future work will occur there.
2020-05-27 22:47:40 -04:00
Joshua Clayton
1699c257c6
Bump version to 0.10.0.0 2019-10-29 20:45:23 -04:00
Joshua Clayton
f1f7382ae4
Update versions to enable installation via Cabal
What?
=====

This updates dependency requirements to enable compilation.
2019-10-29 20:32:54 -04:00
Herbert Valerio Riedel
479174598e Enable Hackage friendly stack.yaml settings (#101)
This will help keeping `unused`'s install-plan from bitrotting over time and therefore avoid our Haddock doc builder failing to rebuild docs, as well as users running into compile errors, and last but not least reduce the overhead for us Hackage Trustees having to step in and fixup .cabal files :-)

(see also documentation at https://docs.haskellstack.org/en/stable/yaml_configuration/#pvp-bounds)

See also https://matrix.hackage.haskell.org/package/unused which shows that most install-plans for `unused` have already bitrotten
2018-08-29 13:07:59 -04:00
Joshua Clayton
514eb94e03
Bump version to 0.9.0.0 2018-08-28 20:55:54 -04:00
Joshua Clayton
2446faee64
Update copyright year to 2018 2018-08-28 20:52:52 -04:00
Joshua Clayton
30950ad00b
Update dependencies
What?
=====

This updates certain dependencies to ensure it can compile both via
Stack and Cabal (which impacts the ability to install via Homebrew).
2018-08-28 16:57:20 -04:00
Joshua Clayton
e8377f5498
Add CircleCI
What?
=====

This introduces CircleCI to the build process.
2018-08-28 16:40:37 -04:00
Joshua Clayton
b616704162
Apply recommendations from hlint
What?
=====

This updates the codebase to switch from data to newtype in certain
cases.
2018-03-18 22:39:39 -04:00
Joshua Clayton
cd1b840368
Allow Stack to build the project and run the test suite
What?
=====

This bumps Stack dependencies and locks certain packages to ensure a
proper build.
2018-03-18 22:35:15 -04:00
Joshua Clayton
e630e8d8c8
Format codebase with hindent 2018-03-18 22:34:45 -04:00
Joshua Clayton
5c08c145a5
Extract app types 2017-05-02 10:25:59 -07:00
Joshua Clayton
0d9a89ae4b
Bump version to 0.8.0.0 2017-04-24 14:30:40 -07:00
Joshua Clayton
789d91b5d9
Bump years 2017-04-24 14:29:05 -07:00
Joshua Clayton
911f49707e
Fix year for 0.7.0.0 2017-04-24 14:27:55 -07:00
Joshua Clayton
64f62d0141
Allow for rg in addition to ag
Why?
====

rg is oftentimes faster for searching across a codebase than ag;
however, it's newer and potentially more unfamiliar, so ag still remains
the default.

This is an introduction to supporting rg, but without updating the
Homebrew recipe yet. Given a trial run, I can imagine switching to it as
a default eventually.
2017-04-24 06:37:20 -07:00
Joshua Clayton
596efc8734
Refactor cache interaction 2017-04-24 06:14:13 -07:00
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