Skip to content

Commit

Permalink
revise: adds the checklist for crate authors
Browse files Browse the repository at this point in the history
  • Loading branch information
claymcleod committed Oct 9, 2024
1 parent 751b363 commit e6773cd
Show file tree
Hide file tree
Showing 6 changed files with 272 additions and 206 deletions.
2 changes: 2 additions & 0 deletions assets/css/main.postcss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@apply dark:prose-code:bg-slate-800;
}



code::before,
code::after {
content: none !important;
Expand Down
62 changes: 31 additions & 31 deletions content/docs/get-started/2.values.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,37 +27,6 @@ provide or mimic functionality that is provided in a library within some other l
will be similarly (or more) performant than the library providing this functionality in
another language.

## Broadly Usable

Crates in the `rust-seq` stack are intended to be broadly used within academic and
industry. As such, they should be **freely-licensed** to enable them to be adopted used
in the broadest variety of contexts. If you do not have a preference on the license, we
recommend you dual license the crate to be used under the [MIT
License](https://opensource.org/license/MIT) or the [Apache-2.0
License](https://opensource.org/license/apache-2-0) at the user's discretion.

Notably, crates _must_ be made accessible under any number of the following licenses (in
alphabetical order):

- [Apache-2.0 License](https://opensource.org/license/apache-2-0)
(learn about this license [here](https://www.tldrlegal.com/license/apache-license-2-0-apache-2-0)),
- [BSD 3-Clause License](https://opensource.org/license/BSD-3-clause)
(learn about this license [here](https://www.tldrlegal.com/license/bsd-3-clause-license-revised)),
- [MIT License](https://opensource.org/license/MIT)
(learn about this license [here](https://www.tldrlegal.com/license/mit-license)),
- or any public domain license (e.g.,
[Unlicense](https://opensource.org/license/unlicense)).

Crates explicitly _must not_ only be available through the following kinds of licenses:

- Any viral/copyleft licenses (any Affero/GPL/LGPL license),
- or anything that stipulates the crate is "free for non-commercial use" (bespoke
licenses),

If any question is not sufficiently covered by the above license reviews, please [file
an
issue](https://github.com/rust-seq/docs/issues/new?labels=license&title=license:%20evaluation%20of%20LICENSE).

## Contributable

Crates in the `rust-seq` stack are designed to be contributed to the community. Though
Expand Down Expand Up @@ -103,3 +72,34 @@ stable), `v1.y.z` is the first stable release that will always remain backwards
compatible for version starting with `v1`, etc). It also means that software will not
unexpectedly break once you've built on top of a particular dependency (not considering,
of course, when software is in the `v0.y.z` stage).

## Broadly Usable

Crates in the `rust-seq` stack are intended to be broadly used within academic and
industry. As such, they should be **freely-licensed** to enable them to be adopted used
in the broadest variety of contexts. If you do not have a preference on the license, we
recommend you dual license the crate to be used under the [MIT
License](https://opensource.org/license/MIT) or the [Apache-2.0
License](https://opensource.org/license/apache-2-0) at the user's discretion.

Notably, crates _must_ be made accessible under any number of the following licenses (in
alphabetical order):

- [Apache-2.0 License](https://opensource.org/license/apache-2-0)
(learn about this license [here](https://www.tldrlegal.com/license/apache-license-2-0-apache-2-0)),
- [BSD 3-Clause License](https://opensource.org/license/BSD-3-clause)
(learn about this license [here](https://www.tldrlegal.com/license/bsd-3-clause-license-revised)),
- [MIT License](https://opensource.org/license/MIT)
(learn about this license [here](https://www.tldrlegal.com/license/mit-license)),
- or any public domain license (e.g.,
[Unlicense](https://opensource.org/license/unlicense)).

Crates explicitly _must not_ only be available through the following kinds of licenses:

- Any viral/copyleft licenses (any Affero/GPL/LGPL license),
- or anything that stipulates the crate is "free for non-commercial use" (bespoke
licenses),

If any question is not sufficiently covered by the above license reviews, please [file
an
issue](https://github.com/rust-seq/docs/issues/new?labels=license&title=license:%20evaluation%20of%20LICENSE).
66 changes: 63 additions & 3 deletions content/docs/writing-crates/1.checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,72 @@

If you're an author of a crate within the `rust-seq` stack _or_ you would like
to be, you can use the following checklist to ensure that your crates meet the
above values. Note that these are just suggestions to adhere to the values
above—completing every item is not a requirement to ratify a particular crate.
above values. For each value, recommendations are listed roughly in order of
most preferrable to least. Note that these are just suggestions to adhere to the
values above—completing every item is not a requirement to ratify a particular
crate.

## Performance
To learn more about any particular value, please see [this
link](../get-started/values).

### Correctness

- [x] Write comprehensive tests to check that all invariants are upheld in the
crate's logic (these also serve as documentation for your code!).
- [x] If you are returning user-facing errors, consider using the
[`anyhow`](https://docs.rs/anyhow/latest/anyhow) crate. Most importantly,
this means (a) returning `anyhow::Result` for your `fn main()`, and (b) using the
[`context()`](https://docs.rs/anyhow/latest/anyhow/trait.Context.html#tymethod.context)
method to add additional context wherever errors might occur.
- [x] Ensure that all errors implement
[`std::error::Error`](https://doc.rust-lang.org/std/error/trait.Error.html)
and that the information returned by
[`std::fmt::Display`](https://doc.rust-lang.org/std/fmt/trait.Display.html)
is helpful. This ensures your custom error types will work well with the
broader Rust ecosystem.
- [x] Use the `debug_assert!` macro throughout your code to plant sanity checks
within the code. Note that this imposes no performance hits for
production-compiled code (`cargo build --release`), as these statements
are not included in these builds.
- [x] If your crate handles user input, integrate a fuzzing suite within your
tests (e.g., with [`cargo-fuzz`](https://github.com/rust-fuzz/cargo-fuzz)).

### Performant

- [x] Provide benchmarks that utilize a benchmarking framework (e.g.,
[Criterion](https://github.com/bheisler/criterion.rs) or
[Divian](https://github.com/nvzqz/divan)) that continuous measure
performance in the CI and track regressions.
- [x] For each data type you expect to be heavily used by users, measure the
amount of memory the type takes up and either via (a) anonymous constants or
(b) unit tests, ensure that the memory required for that data type remains
constant.

### Contributable

- [x] Ensure your crate is **comprehensively tested** to ensure that code can be
modified and refactored by non-experts with confidence.
- [x] Ensure your crate is **comprehensively linted** to ensure that code is of the
highest quality possible.
- [x] Ensure your crate is **comprehensively documented** to ensure that using
the code is clear and straightforward. This means (a) ensuring
documentation for all public-facing code, (b) ensuring documentation for
all private code [to ease development in those areas], and (c) including
examples for any user-facing code to make sure usage is straightforward.
Note that this can be accomplished largely by enabling the
[`missing_docs`](https://doc.rust-lang.org/stable/nightly-rustc/rustc_lint/builtin/static.MISSING_DOCS.html),
[`clippy::missing_docs_in_private_items`](https://rust-lang.github.io/rust-clippy/master/index.html#/missing_docs_in_private_items),
and
[`rustdoc::missing_doc_code_examples`](https://doc.rust-lang.org/stable/nightly-rustc/rustdoc/lint/static.MISSING_DOC_CODE_EXAMPLES.html)
lints.

### Stable

- [x] Ensure your crate follows [semantic versioning](https://semver.org/) and
that you don't introduce breaking changes to your API without incrementing the
major version number.

### Broadly Usable

- [x] Ensure that your code is available under [one of the licenses outlined in
the values section](/docs/get-started/values#broadly-usable).
2 changes: 1 addition & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default defineNuxtConfig({
content: {
documentDriven: true,
markdown: {
remarkPlugins: [remarkGfm],
remarkPlugins: { "remark-gfm": remarkGfm },
rehypePlugins: [],
},
},
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
},
"dependencies": {
"@nuxt/content": "^2.13.2",
"@nuxt/icon": "^1.5.4",
"@nuxt/icon": "^1.5.5",
"@nuxt/ui": "^2.18.6",
"@nuxtjs/color-mode": "^3.5.1",
"@nuxtjs/tailwindcss": "^6.12.1",
"change-case": "^5.4.4",
"d3": "^7.9.0",
"nuxt": "^3.13.0",
"nuxt": "^3.13.2",
"nuxt-lucide-icons": "^1.0.5",
"remark-gfm": "^4.0.0",
"vue": "latest",
Expand Down
Loading

0 comments on commit e6773cd

Please sign in to comment.