Skip to content

Commit 4ba7c5c

Browse files
author
Jonas Bostoen
committed
feat: initial commit
1 parent ea81d28 commit 4ba7c5c

File tree

11 files changed

+239
-0
lines changed

11 files changed

+239
-0
lines changed

.github/.dependabot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "cargo"
9+
labels:
10+
- "T: security"
11+
schedule:
12+
interval: "weekly"
13+
day: "monday"
14+
time: "07:00"

.github/workflows/lint.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches:
6+
- unstable
7+
- main
8+
pull_request:
9+
10+
env:
11+
CARGO_TERM_COLOR: always
12+
13+
jobs:
14+
clippy:
15+
name: clippy
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 30
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: dtolnay/rust-toolchain@nightly
21+
with:
22+
components: clippy
23+
- uses: Swatinem/rust-cache@v2
24+
with:
25+
cache-on-failure: true
26+
- run: cargo clippy --workspace --lib --examples --tests --benches --all-features --locked
27+
env:
28+
RUSTFLAGS: -D warnings
29+
30+
fmt:
31+
name: fmt
32+
runs-on: ubuntu-latest
33+
timeout-minutes: 30
34+
steps:
35+
- uses: actions/checkout@v4
36+
- uses: dtolnay/rust-toolchain@nightly
37+
with:
38+
components: rustfmt
39+
- name: Run fmt
40+
run: cargo fmt --all --check

.github/workflows/unit.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Unit tests
2+
3+
on:
4+
push:
5+
branches:
6+
- unstable
7+
- main
8+
pull_request:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
12+
cancel-in-progress: true
13+
14+
env:
15+
CARGO_TERM_COLOR: always
16+
17+
jobs:
18+
test:
19+
name: test workspace
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 30
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: dtolnay/rust-toolchain@master
25+
# Need to specify @master above to work with toolchain var
26+
with:
27+
toolchain: 1.83.0
28+
- uses: Swatinem/rust-cache@v2
29+
with:
30+
cache-on-failure: true
31+
- uses: taiki-e/install-action@nextest
32+
- name: Run tests
33+
run: cargo nextest run --workspace --retries 3

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/target
2+
.env

Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
[workspace.package]
2+
version = "0.1.0"
3+
edition = "2021"
4+
license = "MIT"
5+
# rust-version = "1.83"
6+
exclude = [".github/"]
7+
repository = "TODO"
8+
9+
10+
[workspace]
11+
members = ["crates/dummy"]
12+
# default-members = [""]
13+
14+
# Explicitly set the resolver to version 2, which is the default for packages with edition >= 2021
15+
# https://doc.rust-lang.org/edition-guide/rust-2021/default-cargo-resolver.html
16+
resolver = "2"
17+
18+
[workspace.dependencies]
19+
dummy = { path = "crates/dummy" }
20+
21+
[workspace.lints]
22+
rust.missing_debug_implementations = "warn"
23+
rust.missing_docs = "warn"
24+
rust.rust_2018_idioms = { level = "deny", priority = -1 }
25+
rust.unreachable_pub = "warn"
26+
rust.unused_must_use = "deny"
27+
rustdoc.all = "warn"
28+
29+
[workspace.lints.clippy]
30+
# These are some of clippy's nursery (i.e., experimental) lints that we like.
31+
# By default, nursery lints are allowed. Some of the lints below have made good
32+
# suggestions which we fixed. The others didn't have any findings, so we can
33+
# assume they don't have that many false positives. Let's enable them to
34+
# prevent future problems.
35+
borrow_as_ptr = "warn"
36+
branches_sharing_code = "warn"
37+
clear_with_drain = "warn"
38+
cloned_instead_of_copied = "warn"
39+
collection_is_never_read = "warn"
40+
dbg_macro = "warn"
41+
derive_partial_eq_without_eq = "warn"
42+
doc_markdown = "warn"
43+
empty_line_after_doc_comments = "warn"
44+
empty_line_after_outer_attr = "warn"
45+
enum_glob_use = "warn"
46+
equatable_if_let = "warn"
47+
explicit_into_iter_loop = "warn"
48+
explicit_iter_loop = "warn"
49+
flat_map_option = "warn"
50+
from_iter_instead_of_collect = "warn"
51+
if_not_else = "warn"
52+
if_then_some_else_none = "warn"
53+
implicit_clone = "warn"
54+
imprecise_flops = "warn"
55+
iter_on_empty_collections = "warn"
56+
iter_on_single_items = "warn"
57+
iter_with_drain = "warn"
58+
iter_without_into_iter = "warn"
59+
large_stack_frames = "warn"
60+
manual_assert = "warn"
61+
manual_clamp = "warn"
62+
manual_is_variant_and = "warn"
63+
manual_string_new = "warn"
64+
match_same_arms = "warn"
65+
missing_const_for_fn = "warn"
66+
mutex_integer = "warn"
67+
naive_bytecount = "warn"
68+
needless_bitwise_bool = "warn"
69+
needless_continue = "warn"
70+
needless_for_each = "warn"
71+
needless_pass_by_ref_mut = "warn"
72+
nonstandard_macro_braces = "warn"
73+
option_as_ref_cloned = "warn"
74+
or_fun_call = "warn"
75+
path_buf_push_overwrite = "warn"
76+
read_zero_byte_vec = "warn"
77+
redundant_clone = "warn"
78+
redundant_else = "warn"
79+
single_char_pattern = "warn"
80+
string_lit_as_bytes = "warn"
81+
string_lit_chars_any = "warn"
82+
suboptimal_flops = "warn"
83+
suspicious_operation_groupings = "warn"
84+
trailing_empty_array = "warn"
85+
trait_duplication_in_bounds = "warn"
86+
transmute_undefined_repr = "warn"
87+
trivial_regex = "warn"
88+
tuple_array_conversions = "warn"
89+
type_repetition_in_bounds = "warn"
90+
uninhabited_references = "warn"
91+
unnecessary_self_imports = "warn"
92+
unnecessary_struct_initialization = "warn"
93+
unnested_or_patterns = "warn"
94+
unused_peekable = "warn"
95+
unused_rounding = "warn"
96+
use_self = "warn"
97+
useless_let_if_seq = "warn"
98+
while_float = "warn"
99+
zero_sized_map_values = "warn"
100+
101+
# These are nursery lints which have findings. Allow them for now. Some are not
102+
# quite mature enough for use in our codebase and some we don't really want.
103+
# Explicitly listing should make it easier to fix in the future.
104+
as_ptr_cast_mut = "allow"
105+
cognitive_complexity = "allow"
106+
debug_assert_with_mut_call = "allow"
107+
fallible_impl_from = "allow"
108+
future_not_send = "allow"
109+
needless_collect = "allow"
110+
non_send_fields_in_send_ty = "allow"
111+
redundant_pub_crate = "allow"
112+
significant_drop_in_scrutinee = "allow"
113+
significant_drop_tightening = "allow"
114+
too_long_first_doc_paragraph = "allow"

bin/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
println!("Hello, world!");
3+
}

crates/dummy/Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[package]
2+
name = "dummy"
3+
version.workspace = true
4+
edition.workspace = true
5+
license.workspace = true
6+
repository.workspace = true
7+
8+
[lints]
9+
workspace = true
10+
11+
[dependencies]

crates/dummy/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
//! Dummy package

rust-toolchain.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[toolchain]
2+
channel = "stable"
3+
version = "1.83.0"

0 commit comments

Comments
 (0)