Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate with notalawyer #59

Merged
merged 7 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ jobs:
- name: cache dependencies
uses: Swatinem/[email protected]

- name: install cargo-about
run: |
cargo install cargo-about

- name: reviewdog / clippy
uses: sksat/[email protected]
with:
Expand Down
34 changes: 34 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ serde = { version = "1", features = ["derive"]}
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
kble-socket = "0.2.0"
notalawyer = "0.1.0"
notalawyer-clap = "0.1.0"
notalawyer-build = "0.1.0"
7 changes: 7 additions & 0 deletions about.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
accepted = [
"MIT",
"Apache-2.0",
"Unicode-DFS-2016",
"MPL-2.0",
"BSD-2-Clause",
]
5 changes: 5 additions & 0 deletions kble-c2a/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ readme.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[build-dependencies]
notalawyer-build.workspace = true

[dependencies]
anyhow.workspace = true
futures.workspace = true
Expand All @@ -19,3 +22,5 @@ bytes.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
clap.workspace = true
notalawyer.workspace = true
notalawyer-clap.workspace = true
3 changes: 3 additions & 0 deletions kble-c2a/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
notalawyer_build::build();
}
3 changes: 2 additions & 1 deletion kble-c2a/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use bytes::BytesMut;
use clap::{Parser, Subcommand};
use futures::{SinkExt, StreamExt};
use kble_c2a::{spacepacket, tfsync};
use notalawyer_clap::*;
use tokio_util::codec::Decoder;
use tracing_subscriber::{prelude::*, EnvFilter};

Expand Down Expand Up @@ -43,7 +44,7 @@ async fn main() -> Result<()> {
.with(EnvFilter::from_default_env())
.init();

let args = Args::parse();
let args = Args::parse_with_license_notice(include_notice!());
match args.command {
Commands::Tfsync => run_tfsync().await,
Commands::Spacepacket { command } => run_spacepacket(command).await,
Expand Down
5 changes: 5 additions & 0 deletions kble-eb90/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ readme.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[build-dependencies]
notalawyer-build.workspace = true

[dependencies]
anyhow.workspace = true
futures.workspace = true
Expand All @@ -20,3 +23,5 @@ tracing.workspace = true
tracing-subscriber.workspace = true
clap.workspace = true
eb90 = "0.1.1"
notalawyer.workspace = true
notalawyer-clap.workspace = true
3 changes: 3 additions & 0 deletions kble-eb90/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
notalawyer_build::build();
}
3 changes: 2 additions & 1 deletion kble-eb90/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use anyhow::Result;
use bytes::BytesMut;
use clap::{Parser, Subcommand};
use futures::{SinkExt, StreamExt};
use notalawyer_clap::*;
use tokio_util::codec::{Decoder, Encoder};
use tracing::warn;
use tracing_subscriber::{prelude::*, EnvFilter};
Expand Down Expand Up @@ -35,7 +36,7 @@ async fn main() -> Result<()> {
.with(EnvFilter::from_default_env())
.init();

let args = Args::parse();
let args = Args::parse_with_license_notice(include_notice!());
match args.command {
Commands::Encode => run_encode().await,
Commands::Decode { buffer_size } => run_decode(buffer_size).await,
Expand Down
5 changes: 5 additions & 0 deletions kble-serialport/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ readme.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[build-dependencies]
notalawyer-build.workspace = true

[dependencies]
anyhow.workspace = true
clap = { workspace = true, features = ["derive", "env"] }
Expand All @@ -21,3 +24,5 @@ axum = { workspace = true, default-features = false, features = ["tokio", "tower
tokio-serial = "5.4"
serde.workspace = true
bytes.workspace = true
notalawyer.workspace = true
notalawyer-clap.workspace = true
3 changes: 3 additions & 0 deletions kble-serialport/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
notalawyer_build::build();
}
3 changes: 2 additions & 1 deletion kble-serialport/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use bytes::BytesMut;
use clap::Parser;
use futures::{SinkExt, StreamExt};
use kble_socket::from_axum;
use notalawyer_clap::*;
use serde::Deserialize;
use tokio::io::{AsyncReadExt, AsyncWriteExt};
use tokio_serial::{DataBits, FlowControl, Parity, SerialPortBuilderExt, SerialStream, StopBits};
Expand Down Expand Up @@ -100,7 +101,7 @@ struct Args {

#[tokio::main]
async fn main() -> Result<()> {
let args = Args::parse();
let args = Args::parse_with_license_notice(include_notice!());

tracing_subscriber::registry()
.with(
Expand Down
5 changes: 5 additions & 0 deletions kble/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ readme.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[build-dependencies]
notalawyer-build.workspace = true

[dependencies]
anyhow.workspace = true
futures.workspace = true
Expand All @@ -21,3 +24,5 @@ clap.workspace = true
serde.workspace = true
serde_yaml = "0.9"
serde_with = "3.4"
notalawyer.workspace = true
notalawyer-clap.workspace = true
3 changes: 3 additions & 0 deletions kble/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
notalawyer_build::build();
}
3 changes: 2 additions & 1 deletion kble/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::path::PathBuf;

use anyhow::{Context, Result};
use clap::Parser;
use notalawyer_clap::*;

mod plug;
mod spaghetti;
Expand All @@ -27,7 +28,7 @@ impl Args {

#[tokio::main]
async fn main() -> Result<()> {
let args = Args::parse();
let args = Args::parse_with_license_notice(include_notice!());
let config = args.load_spaghetti_config()?;
config.run().await?;
Ok(())
Expand Down