Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check unused imports and other linting features #4

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,36 @@
language: rust
rust:
- nightly
before_install:
- |
if [ ! -d "$HOME/.elan/toolchains/" ]; then
curl https://raw.githubusercontent.com/Kha/elan/master/elan-init.sh -sSf | sh -s -- --default-toolchain 3.4.2 -y
fi
install:
- source $HOME/.elan/env || true
- lean -v

script: cargo build
matrix:
include:
- os: osx
- os: linux
# - os: windows
# install:
# - echo 'PATH="$HOME/.elan/bin:$PATH"' >> $HOME/.profile
# - echo 'PATH="/c/Users/$USERNAME/.elan/bin:$PATH"' >> $HOME/.bashrc
# - source $HOME/.profile
# - source $HOME/.bashrc
# - travis_wait lean -v

script:
- travis_wait cargo install --path .
- travis_wait sh run_tests.sh
- travis_wait cargo build --release
- mv target/release/olean-rs target/release/olean-rs-$TRAVIS_OS_NAME
deploy:
provider: releases
api_key: $GITHUB_TOKEN
file: target/release/olean-rs-$TRAVIS_OS_NAME
skip_cleanup: true
on:
tags: true
132 changes: 132 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@ num-traits = "0.2.6"
num-derive = "0.2.3"
byteorder = "1.2.7"
getopts = "0.2"
walkdir = "2"
nibble_vec = "~0.0.3"
endian-type = "0.1.2"
unicode_reader = "0.1.1"
take_mut = "0.2.2"
serde = "1.0.90"
serde_yaml = "0.8.8"
serde_derive = "1.0.90"
thunk = "0.3.0"
# serde_yaml = "0.8.7"
# serde_derive = "0.8.7"
# serde = "1.0.90"
# yaml-rust = "0.4.3"
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ cargo build
## Getting Started

```
Usage: target/debug/olean-rs path/to/file.olean [options]
Usage: target/debug/olean-rs [options]

Options:
-D, --dump FILE dump olean parse
-L give location of lean library
-d, --deps lean.name view all dependents of the target file
-p DIR set current working directory
-l lean.name test lexer
-t lean.name testing
-h, --help print this help menu
-D, --dump FILE dump olean parse
-d, --deps FILE view all dependents of the target file
-u, --unused FILE list unused imports
-L give location of lean library
-p DIR set current working directory
-l lean.name test lexer
-t lean.name testing
-m, --makefile generate a makefile to build project
-h, --help print this help menu
```
17 changes: 17 additions & 0 deletions run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#! /bin/sh
cp target/release/olean-rs test/
lean --make test/simple.lean
lean --make test/simple2.lean
echo "* test -D"
olean-rs -D test/simple.olean > test/simple.lean.actual
diff test/simple.lean.actual test/simple.lean.expected || exit -1

cd test
leanpkg configure
echo "* test -d"
olean-rs -d simple.olean > leanpkg.actual
diff leanpkg.actual leanpkg.expected || exit -1

echo "* test -u"
olean-rs -u simple2.olean > unused.actual
diff unused.actual unused.expected || exit -1
Loading