-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 01742f4
Showing
39 changed files
with
3,202 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[build] | ||
#rustdocflags = ["--document-private-items"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Quality is at the core of the Kodiak brand. We leverage Github Actions, a powerful CI/CD engine, to make sure we meet the expectations. | ||
|
||
Implemented quality checks: | ||
|
||
* cargo test | ||
* cargo fmt --all -- --check | ||
* cargo clippy --all-features -- -D warnings | ||
* cargo tarpaulin --ignore-tests | ||
|
||
Code coverage report is uploaded to Codecov. | ||
|
||
Implemented security checks: | ||
|
||
* cargo audit (runs if dependencies have changed and scheduled once a day) | ||
|
||
Todo: cargo geiger | ||
|
||
# Links | ||
|
||
[https://gist.github.com/LukeMathWalker/5ae1107432ce283310c3e601fac915f3|Github Actions by Luca Palmieri] | ||
|
||
[https://github.com/actions-rs|Rust support for Github Actions] | ||
|
||
[https://github.com/codecov/codecov-action|Action for Codecov Integration] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: workflow-cargo-audit-on-push | ||
run-name: cargo audit run by ${{ github.actor }} | ||
on: | ||
push: | ||
paths: | ||
- '**/Cargo.toml' | ||
- '**/Cargo.lock' | ||
jobs: | ||
cargo-audit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rs/audit-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: workflow-cargo-audit-on-schedule | ||
run-name: cargo audit run by ${{ github.actor }} | ||
on: | ||
schedule: | ||
- cron: "15 10 * * *" | ||
jobs: | ||
cargo-audit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rs/audit-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: workflow-cargo-test | ||
run-name: cargo test run by ${{ github.actor }} | ||
on: [push] | ||
env: | ||
CARGO_TERM_COLOR: always | ||
jobs: | ||
cargo-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
override: true | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
|
||
cargo-fmt: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
components: rustfmt | ||
override: true | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
|
||
cargo-clippy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
components: clippy | ||
override: true | ||
- uses: actions-rs/clippy-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
args: --all-features -- -D warnings | ||
|
||
cargo-tarpaulin: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout-repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: install-toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
|
||
- name: check-coverage | ||
uses: actions-rs/tarpaulin@v0.1 | ||
with: | ||
version: latest | ||
args: --ignore-tests --out Xml --fail-under 100 | ||
|
||
- name: report-coverage | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./cobertura.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/target | ||
/Cargo.lock | ||
.idea | ||
kodiak-sets.iml | ||
|
||
# Build artifacts in examples | ||
/examples/*/target | ||
test.db | ||
test.db-* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,181 @@ | ||
# Checklist for conformance to Rust API guidelines | ||
|
||
copied from [Rust API Guidelines - Checkliste](https://github.com/rust-lang/api-guidelines/blob/master/src/checklist.md), dated Aug 23, 2021, commit: [b2f62d6](https://github.com/rust-lang/api-guidelines/blob/master/src/checklist.md). | ||
|
||
✔: done | 📅 (x.y): planned in release x.y | ⚪: n/a | ❌: failed | ||
|
||
## Naming | ||
|
||
*(crate aligns with Rust naming conventions)* <br/> | ||
|
||
✔ Casing conforms to RFC 430 ([C-CASE]) <br/> | ||
⚪ Ad-hoc conversions follow `as_`, `to_`, `into_` conventions ([C-CONV]) <br/> | ||
✔ Getter names follow Rust convention ([C-GETTER]) <br/> | ||
📅 (0.6) Methods on collections that produce iterators follow `iter`, `iter_mut`, `into_iter` ([C-ITER]) <br/> | ||
📅 (0.6) Iterator type names match the methods that produce them ([C-ITER-TY]) <br/> | ||
⚪ Feature names are free of placeholder words ([C-FEATURE]) <br/> | ||
❌ Names use a consistent word order ([C-WORD-ORDER]) <br/> | ||
|
||
## Interoperability | ||
|
||
*(crate interacts nicely with other library functionality)* <br/> | ||
|
||
✔ Types eagerly implement common traits *(`Copy`, `Clone`, `Eq`, `PartialEq`, `Ord`, `PartialOrd`, `Hash`, `Debug`, `Display`, `Default`)* ([C-COMMON-TRAITS]) <br/> | ||
⚪ Conversions use the standard traits `From`, `AsRef`, `AsMut` ([C-CONV-TRAITS]) <br/> | ||
📅 (0.6) Collections implement `FromIterator` and `Extend` ([C-COLLECT]) <br/> | ||
📅 (0.5) Data structures implement Serde's `Serialize`, `Deserialize` ([C-SERDE]) <br/> | ||
⚪ Types are `Send` and `Sync` where possible ([C-SEND-SYNC]) <br/> | ||
📅 (0.3) Error types are meaningful and well-behaved ([C-GOOD-ERR]) <br/> | ||
⚪ Binary number types provide `Hex`, `Octal`, `Binary` formatting ([C-NUM-FMT]) <br/> | ||
⚪ Generic reader/writer functions take `R: Read` and `W: Write` by value ([C-RW-VALUE]) <br/> | ||
|
||
## Macros | ||
|
||
*(crate presents well-behaved macros)* <br/> | ||
|
||
⚪ Input syntax is evocative of the output ([C-EVOCATIVE]) <br/> | ||
⚪ Macros compose well with attributes ([C-MACRO-ATTR]) <br/> | ||
⚪ Item macros work anywhere that items are allowed ([C-ANYWHERE]) <br/> | ||
⚪ Item macros support visibility specifiers ([C-MACRO-VIS]) <br/> | ||
⚪ Type fragments are flexible ([C-MACRO-TY]) <br/> | ||
|
||
## Documentation | ||
|
||
*(crate is abundantly documented)* <br/> | ||
|
||
✔ Crate level docs are thorough and include examples ([C-CRATE-DOC]) <br/> | ||
📅 (0.3) All items have a rustdoc example ([C-EXAMPLE]) <br/> | ||
✔ Examples use `?`, not `try!`, not `unwrap` ([C-QUESTION-MARK]) <br/> | ||
✔ Function docs include error, panic, and safety considerations ([C-FAILURE]) <br/> | ||
📅 (0.3) Prose contains hyperlinks to relevant things ([C-LINK]) <br/> | ||
✔ Cargo.toml includes all common metadata *(authors, description, license, homepage, documentation, repository, keywords, categories)* ([C-METADATA]) <br/> | ||
✔ Release notes document all significant changes ([C-RELNOTES]) <br/> | ||
✔ Rustdoc does not show unhelpful implementation details ([C-HIDDEN]) <br/> | ||
|
||
## Predictability | ||
|
||
*(crate enables legible code that acts how it looks)* <br/> | ||
|
||
⚪ Smart pointers do not add inherent methods ([C-SMART-PTR]) <br/> | ||
⚪ Conversions live on the most specific type involved ([C-CONV-SPECIFIC]) <br/> | ||
✔ Functions with a clear receiver are methods ([C-METHOD]) <br/> | ||
✔ Functions do not take out-parameters ([C-NO-OUT]) <br/> | ||
⚪ Operator overloads are unsurprising ([C-OVERLOAD]) <br/> | ||
⚪ Only smart pointers implement `Deref` and `DerefMut` ([C-DEREF]) <br/> | ||
✔ Constructors are static, inherent methods ([C-CTOR]) <br/> | ||
|
||
## Flexibility | ||
|
||
*(crate supports diverse real-world use cases)* <br/> | ||
|
||
✔ Functions expose intermediate results to avoid duplicate work ([C-INTERMEDIATE]) <br/> | ||
📅 (0.3) Caller decides where to copy and place data ([C-CALLER-CONTROL]) <br/> | ||
✔ Functions minimize assumptions about parameters by using generics ([C-GENERIC]) <br/> | ||
✔ Traits are object-safe if they may be useful as a trait object ([C-OBJECT]) <br/> | ||
|
||
## Type safety | ||
|
||
*(crate leverages the type system effectively)* <br/> | ||
|
||
⚪ Newtypes provide static distinctions ([C-NEWTYPE]) <br/> | ||
📅 (0.3) Arguments convey meaning through types, not `bool` or `Option` ([C-CUSTOM-TYPE]) <br/> | ||
⚪ Types for a set of flags are `bitflags`, not enums ([C-BITFLAG]) <br/> | ||
⚪ Builders enable construction of complex values ([C-BUILDER]) <br/> | ||
|
||
## Dependability | ||
|
||
*(crate is unlikely to do the wrong thing)* <br/> | ||
|
||
✔ Functions validate their arguments ([C-VALIDATE]) <br/> | ||
⚪ Destructors never fail ([C-DTOR-FAIL]) <br/> | ||
⚪ Destructors that may block have alternatives ([C-DTOR-BLOCK]) <br/> | ||
|
||
## Debuggability | ||
|
||
*(crate is conducive to easy debugging)* <br/> | ||
|
||
✔ All public types implement `Debug` ([C-DEBUG]) <br/> | ||
✔ `Debug` representation is never empty ([C-DEBUG-NONEMPTY]) <br/> | ||
|
||
## Future proofing | ||
|
||
*(crate is free to improve without breaking users' code)* <br/> | ||
|
||
⚪ Sealed traits protect against downstream implementations ([C-SEALED]) <br/> | ||
✔ Structs have private fields ([C-STRUCT-PRIVATE]) <br/> | ||
⚪ Newtypes encapsulate implementation details ([C-NEWTYPE-HIDE]) <br/> | ||
✔ Data structures do not duplicate derived trait bounds ([C-STRUCT-BOUNDS]) <br/> | ||
|
||
## Necessities | ||
|
||
*(to whom they matter, they really matter)* <br/> | ||
|
||
✔ Public dependencies of a stable crate are stable ([C-STABLE]) <br/> | ||
✔ Crate and its dependencies have a permissive license ([C-PERMISSIVE]) <br/> | ||
|
||
|
||
[C-CASE]: https://rust-lang.github.io/api-guidelines/naming.html#c-case | ||
[C-CONV]: https://rust-lang.github.io/api-guidelines/naming.html#c-conv | ||
[C-GETTER]: https://rust-lang.github.io/api-guidelines/naming.html#c-getter | ||
[C-ITER]: https://rust-lang.github.io/api-guidelines/naming.html#c-iter | ||
[C-ITER-TY]: https://rust-lang.github.io/api-guidelines/naming.html#c-iter-ty | ||
[C-FEATURE]: https://rust-lang.github.io/api-guidelines/naming.html#c-feature | ||
[C-WORD-ORDER]: https://rust-lang.github.io/api-guidelines/naming.html#c-word-order | ||
|
||
[C-COMMON-TRAITS]: https://rust-lang.github.io/api-guidelines/interoperability.html#c-common-traits | ||
[C-CONV-TRAITS]: https://rust-lang.github.io/api-guidelines/interoperability.html#c-conv-traits | ||
[C-COLLECT]: https://rust-lang.github.io/api-guidelines/interoperability.html#c-collect | ||
[C-SERDE]: https://rust-lang.github.io/api-guidelines/interoperability.html#c-serde | ||
[C-SEND-SYNC]: https://rust-lang.github.io/api-guidelines/interoperability.html#c-send-sync | ||
[C-GOOD-ERR]: https://rust-lang.github.io/api-guidelines/interoperability.html#c-good-err | ||
[C-NUM-FMT]: https://rust-lang.github.io/api-guidelines/interoperability.html#c-num-fmt | ||
[C-RW-VALUE]: https://rust-lang.github.io/api-guidelines/interoperability.html#c-rw-value | ||
|
||
[C-EVOCATIVE]: https://rust-lang.github.io/api-guidelines/macros.html#c-evocative | ||
[C-MACRO-ATTR]: https://rust-lang.github.io/api-guidelines/macros.html#c-macro-attr | ||
[C-ANYWHERE]: https://rust-lang.github.io/api-guidelines/macros.html#c-anywhere | ||
[C-MACRO-VIS]: https://rust-lang.github.io/api-guidelines/macros.html#c-macro-vis | ||
[C-MACRO-TY]: https://rust-lang.github.io/api-guidelines/macros.html#c-macro-ty | ||
|
||
[C-CRATE-DOC]: https://rust-lang.github.io/api-guidelines/documentation.html#c-crate-doc | ||
[C-EXAMPLE]: https://rust-lang.github.io/api-guidelines/documentation.html#c-example | ||
[C-QUESTION-MARK]: https://rust-lang.github.io/api-guidelines/documentation.html#c-question-mark | ||
[C-FAILURE]: https://rust-lang.github.io/api-guidelines/documentation.html#c-failure | ||
[C-LINK]: https://rust-lang.github.io/api-guidelines/documentation.html#c-link | ||
[C-METADATA]: https://rust-lang.github.io/api-guidelines/documentation.html#c-metadata | ||
[C-HTML-ROOT]: https://rust-lang.github.io/api-guidelines/documentation.html#c-html-root | ||
[C-RELNOTES]: https://rust-lang.github.io/api-guidelines/documentation.html#c-relnotes | ||
[C-HIDDEN]: https://rust-lang.github.io/api-guidelines/documentation.html#c-hidden | ||
|
||
[C-SMART-PTR]: https://rust-lang.github.io/api-guidelines/predictability.html#c-smart-ptr | ||
[C-CONV-SPECIFIC]: https://rust-lang.github.io/api-guidelines/predictability.html#c-conv-specific | ||
[C-METHOD]: https://rust-lang.github.io/api-guidelines/predictability.html#c-method | ||
[C-NO-OUT]: https://rust-lang.github.io/api-guidelines/predictability.html#c-no-out | ||
[C-OVERLOAD]: https://rust-lang.github.io/api-guidelines/predictability.html#c-overload | ||
[C-DEREF]: https://rust-lang.github.io/api-guidelines/predictability.html#c-deref | ||
[C-CTOR]: https://rust-lang.github.io/api-guidelines/predictability.html#c-ctor | ||
|
||
[C-INTERMEDIATE]: https://rust-lang.github.io/api-guidelines/flexibility.html#c-intermediate | ||
[C-CALLER-CONTROL]: https://rust-lang.github.io/api-guidelines/flexibility.html#c-caller-control | ||
[C-GENERIC]: https://rust-lang.github.io/api-guidelines/flexibility.html#c-generic | ||
[C-OBJECT]: https://rust-lang.github.io/api-guidelines/flexibility.html#c-object | ||
|
||
[C-NEWTYPE]: https://rust-lang.github.io/api-guidelines/type-safety.html#c-newtype | ||
[C-CUSTOM-TYPE]: https://rust-lang.github.io/api-guidelines/type-safety.html#c-custom-type | ||
[C-BITFLAG]: https://rust-lang.github.io/api-guidelines/type-safety.html#c-bitflag | ||
[C-BUILDER]: https://rust-lang.github.io/api-guidelines/type-safety.html#c-builder | ||
|
||
[C-VALIDATE]: https://rust-lang.github.io/api-guidelines/dependability.html#c-validate | ||
[C-DTOR-FAIL]: https://rust-lang.github.io/api-guidelines/dependability.html#c-dtor-fail | ||
[C-DTOR-BLOCK]: https://rust-lang.github.io/api-guidelines/dependability.html#c-dtor-block | ||
|
||
[C-DEBUG]: https://rust-lang.github.io/api-guidelines/debuggability.html#c-debug | ||
[C-DEBUG-NONEMPTY]: https://rust-lang.github.io/api-guidelines/debuggability.html#c-debug-nonempty | ||
|
||
[C-SEALED]: https://rust-lang.github.io/api-guidelines/future-proofing.html#c-sealed | ||
[C-STRUCT-PRIVATE]: https://rust-lang.github.io/api-guidelines/future-proofing.html#c-struct-private | ||
[C-NEWTYPE-HIDE]: https://rust-lang.github.io/api-guidelines/future-proofing.html#c-newtype-hide | ||
[C-STRUCT-BOUNDS]: https://rust-lang.github.io/api-guidelines/future-proofing.html#c-struct-bounds | ||
|
||
[C-STABLE]: https://rust-lang.github.io/api-guidelines/necessities.html#c-stable | ||
[C-PERMISSIVE]: https://rust-lang.github.io/api-guidelines/necessities.html#c-permissive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# License implications | ||
|
||
Unless you explicitly state otherwise, any contribution intentionally submitted | ||
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be | ||
dual licensed as above, without any additional terms or conditions. | ||
|
||
# Conventions | ||
|
||
- Semver Versioning Scheme: https://semver.org/spec/v2.0.0.html | ||
- Commit Messages: https://www.conventionalcommits.org/en/v1.0.0/ | ||
- API Guidelines: https://rust-lang.github.io/api-guidelines/ | ||
|
||
# Version control | ||
|
||
- Use feature branches | ||
|
||
``` | ||
git checkout -b feat/<BRANCH_NAME> | ||
``` | ||
|
||
Merge strategy: merge squash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[package] | ||
name = "kodiak-sets" | ||
version = "0.1.0" | ||
authors = ["Tobias Mucke <tobias.mucke@gmail.com", ] | ||
description = "A library to manage generic sets supporting unique features." | ||
categories = ["data-structures"] | ||
keywords = ["set", "sequence", "generic"] | ||
homepage = "https://github.com/polarlabs" | ||
documentation = "https://docs.rs/kodiak-sets" | ||
repository = "https://github.com/polarlabs/kodiak-sets" | ||
readme = "README.md" | ||
edition = "2021" | ||
license = "MIT / Apache-2.0" | ||
|
||
# Exclude files from publishing to crates.io | ||
exclude = [".github"] | ||
|
||
# Disable autodiscovery for tests, use test target (see below) | ||
autotests = false | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
num-integer = "0.1.45" | ||
|
||
# Required for integration tests | ||
[dev-dependencies] | ||
|
||
|
||
# Dedicated target for tests to avoid having one crate per test file, allows code sharing across multiple test files | ||
# How to run tests: | ||
# - all tests: `cargo test` | ||
# - unit tests only: `cargo test --lib` | ||
# - integration tests only: `cargo test --test integration` | ||
# - doc tests only: `cargo test --doc` | ||
#[[test]] | ||
#name = "integration" | ||
#path = "tests/lib.rs" |
Oops, something went wrong.