diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d4b9593b0..39811357e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -107,6 +107,12 @@ jobs: - name: rustfmt run: cargo fmt --check --all + - name: Install rust-sort + run: cargo install --git=https://github.com/DevinR528/cargo-sort --rev 55ec89082466f6bb246d870a8d56d166a8e1f08b cargo-sort + + - name: Check formatting and item order of Cargo.toml files + run: cargo sort --check --check-format --grouped --workspace + CI-success: if: ${{ always() }} runs-on: ubuntu-latest diff --git a/Cargo.toml b/Cargo.toml index f1822c611..c6044f076 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,16 +1,16 @@ [workspace] members = [ - "src/*", - "src/riot-rs", - "src/riot-rs-boards", - "src/riot-rs-boards/lm3s6965evb", - "src/riot-rs-boards/nrf52", - "src/riot-rs-boards/nrf52840dk", - "src/riot-rs-boards/nucleo-f401re", - "src/riot-rs-chips", - "src/riot-rs-macros", - "src/lib/*", - "examples/*", + "examples/*", + "src/*", + "src/lib/*", + "src/riot-rs", + "src/riot-rs-boards", + "src/riot-rs-boards/lm3s6965evb", + "src/riot-rs-boards/nrf52", + "src/riot-rs-boards/nrf52840dk", + "src/riot-rs-boards/nucleo-f401re", + "src/riot-rs-chips", + "src/riot-rs-macros" ] exclude = ["src/lib"] @@ -33,12 +33,12 @@ critical-section = { version = "1.1.2" } embassy-executor = { version = "0.5", default-features = false } embassy-net = { version = "0.4", default-features = false } +embassy-net-driver-channel = { version = "0.2.0", default-features = false } embassy-nrf = { version = "0.1", default-features = false } embassy-rp = { version = "0.1", default-features = false } embassy-sync = { version = "0.5", default-features = false } embassy-time = { version = "0.3", default-features = false } embassy-usb = { version = "0.1", default-features = false } -embassy-net-driver-channel = { version = "0.2.0", default-features = false } linkme = { version = "0.3.21", features = ["used_linker"] } @@ -46,11 +46,11 @@ riot-rs = { path = "src/riot-rs" } riot-rs-rt = { path = "src/riot-rs-rt" } riot-rs-runqueue = { path = "src/riot-rs-runqueue" } +const_panic = { version = "0.2.8", default_features = false } heapless = { version = "0.8.0", default-features = false } -static_cell = { version = "2.0.0", features = [ "nightly" ] } -ld-memory = { version = "0.2.9" } konst = { version = "0.3.8", default_features = false } -const_panic = { version = "0.2.8", default_features = false } +ld-memory = { version = "0.2.9" } +static_cell = { version = "2.0.0", features = [ "nightly" ] } [profile.dev] incremental = false @@ -69,8 +69,8 @@ opt-level = "s" [patch.crates-io] # these are patched to work with critical-section nrf51-pac = { git = "https://github.com/kaspar030/nrf-pacs", branch = "riot-rs" } -nrf52840-pac = { git = "https://github.com/kaspar030/nrf-pacs", branch = "riot-rs" } nrf52832-pac = { git = "https://github.com/kaspar030/nrf-pacs", branch = "riot-rs" } +nrf52840-pac = { git = "https://github.com/kaspar030/nrf-pacs", branch = "riot-rs" } # riot-rs embassy fork embassy-executor = { git = "https://github.com/kaspar030/embassy", branch = "for-riot-rs-140224" } diff --git a/examples/embassy-http-server/Cargo.toml b/examples/embassy-http-server/Cargo.toml index 6c103f57e..7e97e235f 100644 --- a/examples/embassy-http-server/Cargo.toml +++ b/examples/embassy-http-server/Cargo.toml @@ -6,18 +6,18 @@ edition.workspace = true publish = false [dependencies] -riot-rs = { path = "../../src/riot-rs", features = ["time", "override-network-config"] } -riot-rs-boards = { path = "../../src/riot-rs-boards" } embassy-executor = { workspace = true, default-features = false } +embassy-net = { workspace = true, features = ["tcp"] } embassy-sync = { workspace = true } embassy-time = { workspace = true, default-features = false } -embassy-net = { workspace = true, features = ["tcp"] } embedded-io-async = "0.6.0" heapless = { workspace = true } httparse = { version = "1.8.0", default-features = false } picoserve = { version = "0.8.0", default-features = false, features = ["embassy"] } -static_cell = { workspace = true } +riot-rs = { path = "../../src/riot-rs", features = ["time", "override-network-config"] } +riot-rs-boards = { path = "../../src/riot-rs-boards" } serde = { version = "1.0", default-features = false } +static_cell = { workspace = true } embassy-nrf = { workspace = true, optional = true } diff --git a/examples/embassy-net-tcp/Cargo.toml b/examples/embassy-net-tcp/Cargo.toml index 68c0ab61d..4b9c40dfe 100644 --- a/examples/embassy-net-tcp/Cargo.toml +++ b/examples/embassy-net-tcp/Cargo.toml @@ -6,10 +6,10 @@ edition.workspace = true publish = false [dependencies] -riot-rs = { path = "../../src/riot-rs", features = ["time", "override-network-config"] } -riot-rs-boards = { path = "../../src/riot-rs-boards" } embassy-executor = { workspace = true, default-features = false } -embassy-time = { workspace = true, default-features = false } embassy-net = { workspace = true, features = ["tcp" ] } +embassy-time = { workspace = true, default-features = false } embedded-io-async = "0.6.1" heapless = { workspace = true } +riot-rs = { path = "../../src/riot-rs", features = ["time", "override-network-config"] } +riot-rs-boards = { path = "../../src/riot-rs-boards" } diff --git a/examples/embassy-net-udp/Cargo.toml b/examples/embassy-net-udp/Cargo.toml index e20cedd07..45fe73659 100644 --- a/examples/embassy-net-udp/Cargo.toml +++ b/examples/embassy-net-udp/Cargo.toml @@ -6,10 +6,10 @@ edition.workspace = true publish = false [dependencies] -riot-rs = { path = "../../src/riot-rs", features = ["time", "override-network-config"] } -riot-rs-boards = { path = "../../src/riot-rs-boards" } embassy-executor = { workspace = true, default-features = false } -embassy-time = { workspace = true, default-features = false } embassy-net = { workspace = true, features = ["udp"] } +embassy-time = { workspace = true, default-features = false } embedded-io-async = "0.6.1" heapless = { workspace = true } +riot-rs = { path = "../../src/riot-rs", features = ["time", "override-network-config"] } +riot-rs-boards = { path = "../../src/riot-rs-boards" } diff --git a/examples/embassy-usb-keyboard/Cargo.toml b/examples/embassy-usb-keyboard/Cargo.toml index 707517e69..ec76f9167 100644 --- a/examples/embassy-usb-keyboard/Cargo.toml +++ b/examples/embassy-usb-keyboard/Cargo.toml @@ -6,12 +6,12 @@ edition.workspace = true publish = false [dependencies] -riot-rs = { path = "../../src/riot-rs", features = ["time", "usb"] } -riot-rs-boards = { path = "../../src/riot-rs-boards" } embassy-executor = { workspace = true, default-features = false } embassy-nrf = { workspace = true, default-features = false } embassy-sync = { workspace = true } -embassy-usb = { workspace = true, features = ["usbd-hid"] } embassy-time = { workspace = true, default-features = false } +embassy-usb = { workspace = true, features = ["usbd-hid"] } +riot-rs = { path = "../../src/riot-rs", features = ["time", "usb"] } +riot-rs-boards = { path = "../../src/riot-rs-boards" } static_cell = { workspace = true } -usbd-hid = { version = "0.6.1"} +usbd-hid = { version = "0.6.1" } diff --git a/examples/embassy/Cargo.toml b/examples/embassy/Cargo.toml index 7a75af76b..f6fefbd7b 100644 --- a/examples/embassy/Cargo.toml +++ b/examples/embassy/Cargo.toml @@ -6,8 +6,8 @@ edition.workspace = true publish = false [dependencies] -riot-rs = { path = "../../src/riot-rs", features = [ "threading", "time"] } -riot-rs-boards = { path = "../../src/riot-rs-boards" } embassy-executor = { workspace = true, default-features = false } -embassy-time = { workspace = true, default-features = false } embassy-sync = { workspace = true, default-features = false } +embassy-time = { workspace = true, default-features = false } +riot-rs = { path = "../../src/riot-rs", features = [ "threading", "time"] } +riot-rs-boards = { path = "../../src/riot-rs-boards" } diff --git a/src/lib/clist/Cargo.toml b/src/lib/clist/Cargo.toml index f02249edd..069c6f876 100644 --- a/src/lib/clist/Cargo.toml +++ b/src/lib/clist/Cargo.toml @@ -6,7 +6,6 @@ edition = "2021" homepage = "https://github.com/future-proof-iot/RIOT-rs" license = "Apache-2.0" description = "A hairy circular linked list for no_std environments." - # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies.memoffset] diff --git a/src/lib/ringbuffer/Cargo.toml b/src/lib/ringbuffer/Cargo.toml index 542caf8d0..aa8c19a39 100644 --- a/src/lib/ringbuffer/Cargo.toml +++ b/src/lib/ringbuffer/Cargo.toml @@ -3,7 +3,6 @@ name = "ringbuffer" version = "0.1.0" authors = ["Kaspar Schleiser "] edition = "2021" - # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/src/riot-rs-boards/Cargo.toml b/src/riot-rs-boards/Cargo.toml index a40d4dc7a..5e7f1667e 100644 --- a/src/riot-rs-boards/Cargo.toml +++ b/src/riot-rs-boards/Cargo.toml @@ -10,15 +10,15 @@ linkme.workspace = true riot-rs-rt = { path = "../riot-rs-rt" } -lm3s6965evb = { optional=true, path="lm3s6965evb" } -nrf52dk = { optional=true, path="nrf52dk" } -nrf52840dk = { optional=true, path="nrf52840dk" } -nrf52840-mdk = { optional=true, path="nrf52840-mdk" } -nucleo-f401re = { optional=true, path="nucleo-f401re" } -microbit = { optional=true, path="microbit" } -microbit-v2 = { optional=true, path="microbit-v2" } -dwm1001 = { optional=true, path="dwm1001" } -rpi-pico = { optional=true, path="rpi-pico" } +dwm1001 = { optional = true, path = "dwm1001" } +lm3s6965evb = { optional = true, path = "lm3s6965evb" } +microbit = { optional = true, path = "microbit" } +microbit-v2 = { optional = true, path = "microbit-v2" } +nrf52840-mdk = { optional = true, path = "nrf52840-mdk" } +nrf52840dk = { optional = true, path = "nrf52840dk" } +nrf52dk = { optional = true, path = "nrf52dk" } +nucleo-f401re = { optional = true, path = "nucleo-f401re" } +rpi-pico = { optional = true, path = "rpi-pico" } [features] -rpi-pico-w = [ "rpi-pico/rpi-pico-w" ] +rpi-pico-w = ["rpi-pico/rpi-pico-w"] diff --git a/src/riot-rs-boards/nrf52/Cargo.toml b/src/riot-rs-boards/nrf52/Cargo.toml index 25063e8da..56d36e394 100644 --- a/src/riot-rs-boards/nrf52/Cargo.toml +++ b/src/riot-rs-boards/nrf52/Cargo.toml @@ -5,13 +5,13 @@ authors = ["Kaspar Schleiser "] edition = "2021" [dependencies] -riot-rs-rt = { path = "../../riot-rs-rt", features = ["rtt-target"] } nrf52832-pac = { version = "0.12.2", default-features = false, features = [ "rt", ], optional = true } nrf52840-pac = { version = "0.12.2", default-features = false, features = [ "rt", ], optional = true } +riot-rs-rt = { path = "../../riot-rs-rt", features = ["rtt-target"] } [features] nrf52832 = ["dep:nrf52832-pac"] diff --git a/src/riot-rs-boards/nrf52840dk/Cargo.toml b/src/riot-rs-boards/nrf52840dk/Cargo.toml index 51e696e1b..727863665 100644 --- a/src/riot-rs-boards/nrf52840dk/Cargo.toml +++ b/src/riot-rs-boards/nrf52840dk/Cargo.toml @@ -5,8 +5,8 @@ authors.workspace = true edition.workspace = true [dependencies] -cortex-m-rt.workspace = true cortex-m.workspace = true +cortex-m-rt.workspace = true riot-rs-rt.workspace = true diff --git a/src/riot-rs-boards/nucleo-f401re/Cargo.toml b/src/riot-rs-boards/nucleo-f401re/Cargo.toml index c6b1c3dae..160d1e561 100644 --- a/src/riot-rs-boards/nucleo-f401re/Cargo.toml +++ b/src/riot-rs-boards/nucleo-f401re/Cargo.toml @@ -3,8 +3,7 @@ name = "nucleo-f401re" version = "0.1.0" authors = ["Kaspar Schleiser "] edition = "2021" - # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -stm32f4xx = { path="../../riot-rs-chips/stm32f4xx", features=["stm32f401"] } +stm32f4xx = { path = "../../riot-rs-chips/stm32f4xx", features = ["stm32f401"] } diff --git a/src/riot-rs-chips/Cargo.toml b/src/riot-rs-chips/Cargo.toml index cf8498166..629e3d2fd 100644 --- a/src/riot-rs-chips/Cargo.toml +++ b/src/riot-rs-chips/Cargo.toml @@ -3,11 +3,10 @@ name = "riot-rs-chips" version = "0.1.0" authors = ["Kaspar Schleiser "] edition = "2021" - # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -stm32f4xx = { optional=true, path="stm32f4xx" } +stm32f4xx = { optional = true, path = "stm32f4xx" } [features] -stm32f401 = ["stm32f4xx/stm32f401" ] +stm32f401 = ["stm32f4xx/stm32f401"] diff --git a/src/riot-rs-core/Cargo.toml b/src/riot-rs-core/Cargo.toml index 76902b350..c32670ad1 100644 --- a/src/riot-rs-core/Cargo.toml +++ b/src/riot-rs-core/Cargo.toml @@ -7,9 +7,9 @@ edition = "2021" links = "riot-rs-core" [dependencies] -riot-rs-threads = { path = "../riot-rs-threads" } critical-section.workspace = true ref-cast = "1.0" +riot-rs-threads = { path = "../riot-rs-threads" } ringbuffer = { path = "../lib/ringbuffer" } @@ -20,5 +20,5 @@ thread_info = [] cbindgen = "0.26.*" [dev-dependencies] -riot-rs-rt = { path = "../riot-rs-rt" } riot-rs-boards = { path = "../riot-rs-boards" } +riot-rs-rt = { path = "../riot-rs-rt" } diff --git a/src/riot-rs-embassy/Cargo.toml b/src/riot-rs-embassy/Cargo.toml index ac42d042e..d54d30be8 100644 --- a/src/riot-rs-embassy/Cargo.toml +++ b/src/riot-rs-embassy/Cargo.toml @@ -4,22 +4,22 @@ version = "0.1.0" edition = "2021" [dependencies] -# always +critical-section.workspace = true linkme.workspace = true static_cell.workspace = true -critical-section.workspace = true + embassy-executor = { workspace = true, features = ["nightly"] } +embassy-net = { workspace = true, optional = true, features = [ "dhcpv4", "medium-ethernet" ] } +embassy-net-driver-channel = { workspace = true, optional = true } embassy-sync = { workspace = true } +embassy-time = { workspace = true, optional = true } +embassy-usb = { workspace = true, optional = true } + +# always riot-rs-core = { path = "../riot-rs-core", optional = true } riot-rs-rt = { path = "../riot-rs-rt" } riot-rs-utils = { path = "../riot-rs-utils" } -# time -embassy-time = { workspace = true, optional = true } - -embassy-usb = { workspace = true, optional = true } -embassy-net = { workspace = true, optional = true, features = [ "dhcpv4", "medium-ethernet" ] } -embassy-net-driver-channel = { workspace = true, optional = true } heapless = "0.8.0" # rpi-pico-w cyw43 @@ -60,11 +60,11 @@ embassy-rp = { workspace = true, features = [ [features] time = ["dep:embassy-time", "embassy-executor/integrated-timers"] -usb = [ "dep:embassy-usb" ] -net = [ "dep:embassy-net" ] -usb_ethernet = [ "usb", "net" ] +usb = ["dep:embassy-usb"] +net = ["dep:embassy-net"] +usb_ethernet = ["usb", "net"] -wifi_cyw43 = [ "dep:cyw43", "dep:cyw43-pio", "dep:embassy-net-driver-channel", "net" ] +wifi_cyw43 = ["dep:cyw43", "dep:cyw43-pio", "dep:embassy-net-driver-channel", "net"] threading = ["dep:riot-rs-core"] override-network-config = [] diff --git a/src/riot-rs-macros/Cargo.toml b/src/riot-rs-macros/Cargo.toml index f9f0ebcf3..d08bb3005 100644 --- a/src/riot-rs-macros/Cargo.toml +++ b/src/riot-rs-macros/Cargo.toml @@ -4,7 +4,6 @@ version.workspace = true authors.workspace = true edition.workspace = true repository.workspace = true - # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/src/riot-rs-utils/Cargo.toml b/src/riot-rs-utils/Cargo.toml index 469c7f929..b35940f99 100644 --- a/src/riot-rs-utils/Cargo.toml +++ b/src/riot-rs-utils/Cargo.toml @@ -5,6 +5,6 @@ authors.workspace = true edition.workspace = true [dependencies] +const_panic = { workspace = true } # env utils konst = { workspace = true, features = ["parsing"] } -const_panic = { workspace = true } diff --git a/src/riot-rs/Cargo.toml b/src/riot-rs/Cargo.toml index f858737a3..dea25b12a 100644 --- a/src/riot-rs/Cargo.toml +++ b/src/riot-rs/Cargo.toml @@ -6,22 +6,22 @@ edition.workspace = true [dependencies] linkme = { workspace = true } -riot-rs-rt = { path = "../riot-rs-rt" } -riot-rs-threads = { path = "../riot-rs-threads", optional = true } riot-rs-boards = { path = "../riot-rs-boards" } riot-rs-buildinfo = { path = "../riot-rs-buildinfo" } riot-rs-embassy = { path = "../riot-rs-embassy" } riot-rs-macros = { path = "../riot-rs-macros" } +riot-rs-rt = { path = "../riot-rs-rt" } +riot-rs-threads = { path = "../riot-rs-threads", optional = true } static_cell = { workspace = true } [features] -debug-console = [ "riot-rs-rt/debug-console" ] -silent-panic = [ "riot-rs-rt/silent-panic" ] -threading = ["dep:riot-rs-threads", "riot-rs-rt/threading", "riot-rs-embassy/threading" ] -time = [ "riot-rs-embassy/time" ] -usb = [ "riot-rs-embassy/usb" ] -net = [ "riot-rs-embassy/net" ] -usb_ethernet = [ "riot-rs-embassy/usb_ethernet" ] -wifi_cyw43 = [ "riot-rs-embassy/wifi_cyw43" ] +debug-console = ["riot-rs-rt/debug-console"] +net = ["riot-rs-embassy/net"] override-network-config = ["riot-rs-embassy/override-network-config"] override-usb-config = ["riot-rs-embassy/override-usb-config"] +silent-panic = ["riot-rs-rt/silent-panic"] +threading = ["dep:riot-rs-threads", "riot-rs-rt/threading", "riot-rs-embassy/threading"] +time = ["riot-rs-embassy/time"] +usb = ["riot-rs-embassy/usb"] +usb_ethernet = ["riot-rs-embassy/usb_ethernet"] +wifi_cyw43 = ["riot-rs-embassy/wifi_cyw43"]