Skip to content

Commit

Permalink
Prepare for 0.1.0 release
Browse files Browse the repository at this point in the history
What?
=====

This updates the release workflow and binary name and fleshes out more
of the README, documenting installation and usage.
  • Loading branch information
joshuaclayton committed May 28, 2020
1 parent b933ccd commit 5e28d64
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,21 +120,21 @@ jobs:
echo "release version: $RELEASE_VERSION"
- name: Build release binary
run: ${{ env.CARGO }} build --verbose --release --bin unused-rs ${{ env.TARGET_FLAGS }}
run: ${{ env.CARGO }} build --verbose --release --bin unused ${{ env.TARGET_FLAGS }}

- name: Strip release binary (Linux and macOS)
if: matrix.build == 'linux' || matrix.build == 'macos'
run: strip "target/${{ matrix.target }}/release/unused-rs"
run: strip "target/${{ matrix.target }}/release/unused"

- name: Build archive
shell: bash
run: |
staging="unused-rs-${{ env.RELEASE_VERSION }}-${{ matrix.target }}"
staging="unused-${{ env.RELEASE_VERSION }}-${{ matrix.target }}"
mkdir -p "$staging"
cp {README.md,LICENSE} "$staging/"
cp "target/${{ matrix.target }}/release/unused-rs" "$staging/"
cp "target/${{ matrix.target }}/release/unused" "$staging/"
tar czf "$staging.tar.gz" "$staging"
echo "::set-env name=ASSET::$staging.tar.gz"
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ name = "tracked-files-rs"
path = "src/bin/codebase_files.rs"

[[bin]]
name = "unused-rs"
name = "unused"
path = "src/bin/unused.rs"

[workspace]
Expand Down
77 changes: 74 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,82 @@
![CI](https://github.com/unused-code/unused_rs/workflows/CI/badge.svg)
![Security audit](https://github.com/unused-code/unused_rs/workflows/Security%20audit/badge.svg)

Unused identifies possible dead code in dynamic programming languages.
Unused identifies unused code in Rails, Phoenix, and other types of
applications, improving developer productivity

The first version of this was written in Haskell, available [here].
![Screenshot of Unused Output](https://unused.codes/images/unused-output.png)

[here]: https://github.com/joshuaclayton/unused
## Installing and Updating

### Homebrew (Recommended)

You can install [the formulae] via [Homebrew] with `brew tap`:

```sh
brew tap unused-code/formulae
```

Next, run:

```sh
brew install unused
```

[the formulae]: https://github.com/unused-code/formulae
[Homebrew]: http://brew.sh/

This will install `unused` and its corresponding dependencies.

To update, run:

```sh
brew update
brew upgrade unused
```

## Prerequisites

It is strongly recommended you install [Universal Ctags] to generate tags
files. Universal Ctags supports more languages and has native parsers for a
good number of them, resulting in faster tags generation time.

[Universal Ctags]: https://ctags.io/

It is also recommended that you have a tags file generated on a semi-regular
basis. Tim Pope wrote an article about [wiring up ctags generation] with a [git
hook]. thoughtbot's dotfiles also reference a [ctags git hook].

[wiring up ctags generation]: https://tbaggery.com/2011/08/08/effortless-ctags-with-git.html
[git hook]: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
[ctags git hook]: https://github.com/thoughtbot/dotfiles/blob/master/git_template/hooks/ctags

## Usage

From your project directory, run:

```sh
unused
```

This will generate a list of tokens and corresponding definition locations for
removal consideration.

You can see supported command-line flags with:

```sh
unused --help
```

## Troubleshooting

If you run into trouble, run

```sh
unused doctor
```

This will perform a series of simple checks to help identify obvious issues
with configuration.

## License

Expand Down

0 comments on commit 5e28d64

Please sign in to comment.