Skip to content

Commit

Permalink
chore: add a justfile (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
KSXGitHub authored Sep 10, 2023
1 parent 5cf2291 commit 1873504
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 10 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## WHATWG URL parser for Rust

Fast [WHATWG URL Specification](https://url.spec.whatwg.org) compliant URL parser for Rust.
Fast [WHATWG URL Specification](https://url.spec.whatwg.org) compliant URL parser for Rust.
Well-tested and widely used by Node.js since [Node 18](https://nodejs.org/en/blog/release/v18.17.0).

The Ada library passes the full range of tests from the specification, across a wide range of platforms (e.g., Windows, Linux, macOS).
Expand All @@ -25,13 +25,13 @@ fn main() {

#### Features

**std:** Functionalities that require `std`.
**std:** Functionalities that require `std`.
This feature is enabled by default, set `no-default-features` to `true` if you want `no-std`.

**serde:** Allow `Url` to work with `serde`. This feature is disabled by default. Enabling this feature without `std` would provide you only `Serialize`.
**serde:** Allow `Url` to work with `serde`. This feature is disabled by default. Enabling this feature without `std` would provide you only `Serialize`.
Enabling this feature and `std` would provide you both `Serialize` and `Deserialize`.

**libcpp:** Build `ada-url` with `libc++`. This feature is disabled by default.
**libcpp:** Build `ada-url` with `libc++`. This feature is disabled by default.
Enabling this feature without `libc++` installed would cause compile error.

### Performance
Expand Down Expand Up @@ -67,24 +67,24 @@ parse/url time: [6.9266 µs 6.9677 µs 7.0199 µs]

### Development

#### `test.sh`
#### `justfile`

`test.sh` is a convenient helper script that would allow developer to quickly and comprehensively check, lint, and test their code and documentation.
The [`justfile`](./justfile) contains commands (called "recipes") that can be executed by [just](https://github.com/casey/just) for convenience.

**Basic Usage:**
**Run all lints and tests:**

```sh
./test.sh
just all
```

**Skipping features:**

```sh
SKIP_FEATURES=serde,libcpp ./test.sh
just all --skip=libcpp,serde
```

### License

This code is made available under the Apache License 2.0 as well as the MIT license.
This code is made available under the Apache License 2.0 as well as the MIT license.

Our tests include third-party code and data. The benchmarking code includes third-party code: it is provided for research purposes only and not part of the library.
20 changes: 20 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
_default:
@just --list --unsorted

# run doc, clippy, and test recipies
all *args:
just doc {{args}}
just clippy {{args}}
just test {{args}}

# run tests on all feature combinations
test *args:
cargo hack test --feature-powerset {{args}}

# type check and lint code on all feature combinations
clippy *args:
cargo hack clippy --feature-powerset {{args}} -- -D warnings

# lint documentation on all feature combinations
doc *args:
RUSTDOCFLAGS='-D warnings' cargo hack doc --feature-powerset {{args}}

0 comments on commit 1873504

Please sign in to comment.