Skip to content

Commit

Permalink
[num-format] Add justfile to replace scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
bcmyers committed Oct 10, 2022
1 parent 91c783b commit 133d20c
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 62 deletions.
24 changes: 18 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ problem, any possible alternatives, and any disadvantages.
development, including the submodule:

```bash
$ git clone [email protected]:bcmyers/num-format.git
$ cd num-format
$ git submodule init
$ git submodule update
git clone [email protected]:bcmyers/num-format.git
cd num-format
git submodule init
git submodule update
```

### Running the test suite
Expand All @@ -34,10 +34,22 @@ tests for you.

To run the full test suite:

* Install [just](https://github.com/casey/just) if it is not already installed

```bash
cargo install just
```

* Install [cargo-hack](https://github.com/taiki-e/cargo-hack) if it is not already installed

```bash
cargo install cargo-hack
```

* Make sure you're in the root directory (the directory with the workspace Cargo.toml), and then...

```bash
$ ./scripts/test.sh
just test
```

### num-format-dev
Expand All @@ -55,7 +67,7 @@ To run num-format-dev (thereby re-creating `num-format/src/locale.rs`):
* Make sure you're in the root directory (the directory with the workspace Cargo.toml), and then...

```bash
$ ./scripts/locale.sh
just locale
```

You only need to run num-format-dev if you wish to modify `num-format/src/locale.rs`.
Expand Down
37 changes: 37 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
default: check

bench:
cargo bench --manifest-path num-format-benches/Cargo.toml

check:
cargo clippy --all-features --all-targets --tests --workspace

clippy: check

fmt:
cargo fmt --all

locale:
cargo run --manifest-path num-format-dev/Cargo.toml
cargo fmt --all

readme:
#!/usr/bin/env bash
set -euo pipefail
(
cd num-format
cargo readme > README.md
)
cp num-format/README.md ./README.md
(
cd num-format-windows
cargo readme > README.md
)
test:
cargo fmt --all --check
cargo clippy --all-features --all-targets --tests --workspace -- -D warnings
cargo hack --package num-format --feature-powerset test
cargo hack --package num-format-benches --feature-powerset test
cargo hack --package num-format-dev --feature-powerset test
cargo hack --package num-format-windows --feature-powerset test
1 change: 0 additions & 1 deletion scripts/README.md

This file was deleted.

3 changes: 0 additions & 3 deletions scripts/bench.sh

This file was deleted.

16 changes: 0 additions & 16 deletions scripts/check.sh

This file was deleted.

6 changes: 0 additions & 6 deletions scripts/locale.sh

This file was deleted.

14 changes: 0 additions & 14 deletions scripts/readme.sh

This file was deleted.

16 changes: 0 additions & 16 deletions scripts/test.sh

This file was deleted.

0 comments on commit 133d20c

Please sign in to comment.