add taskfile and cleanup project

This commit is contained in:
Joey Hines 2026-03-15 18:46:13 -06:00
parent 3ef95614f0
commit 05e773d62c
Signed by: joeyahines
GPG Key ID: E99D8FB14855100E
5 changed files with 49 additions and 39 deletions

View File

@ -1,31 +0,0 @@
clone:
git:
image: "woodpeckerci/plugin-git:next"
pipeline:
compliance:
commands:
- "rustup component add clippy"
- "cargo build --verbose"
- "cargo clippy --workspace --tests --all-targets --all-features"
- "cargo test --workspace --no-fail-fast"
image: "rust:1.77-buster"
when:
event: pull_request, push
build:
commands:
- "cargo build --release"
image: "rust:1.77-buster"
when:
branch: main
event: push
release:
image: jolheiser/drone-gitea-main:latest
settings:
token:
from_secret: gitea_token
base: https://git.jojodev.com
files:
- "target/release/formaty"
when:
branch: main
event: push

39
Taskfile.yml Normal file
View File

@ -0,0 +1,39 @@
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: '3'
tasks:
version:
desc: Print out Rust version info
cmds:
- cargo --version
- rustc --version
- cargo clippy --version
build:
desc: Debug build
cmds:
- cargo build --timings --tests --bins
test:
desc: Test code
deps: [build]
cmds:
- cargo test --locked
build:release:
desc: Release build
cmds:
- cargo build --release --locked --timings
fmt:
desc: Format Rust code
cmds:
- cargo fmt
check:
desc: Lint code with Clippy
cmds:
- cargo check
- cargo fmt --check
- cargo clippy
clean:
desc: Purge Rust build cache
cmds:
- cargo clean

View File

@ -1,5 +1,5 @@
use crate::formatter::format::FormatError;
use crate::formatter::FormatConfigError;
use crate::formatter::format::FormatError;
use crate::parser::ByteArrayParseErr;
use std::error::Error;
use std::fmt::{Display, Formatter};

View File

@ -2,7 +2,7 @@ use std::fmt::Write;
use std::io::Cursor;
use std::string::FromUtf8Error;
use crate::byte_stream::{bit_mask, ByteStream, ByteStreamError};
use crate::byte_stream::{ByteStream, ByteStreamError, bit_mask};
use crate::formatter::bytes_operations::ByteOrderOperations;
use crate::formatter::format_config::FormatConfig;
use crate::formatter::printers::PrintType;
@ -351,10 +351,10 @@ impl Format {
#[cfg(test)]
mod tests {
use crate::Format;
use crate::byte_stream::ByteStream;
use crate::formatter::format::{Endianness, Field, FieldType};
use crate::formatter::format_config::FormatConfig;
use crate::Format;
#[test]
fn test_format_int_4_bits() {
@ -504,9 +504,11 @@ mod tests {
let mut byte_stream = ByteStream::from(b"\x3D\x70\xA3\xD7".to_vec());
assert!(field
.format_data(&mut byte_stream, 0, &FormatConfig::default())
.is_err())
assert!(
field
.format_data(&mut byte_stream, 0, &FormatConfig::default())
.is_err()
)
}
#[test]

View File

@ -1,10 +1,10 @@
use crate::deframer::Deframer;
use crate::formatter::format::{Format, FormatError};
use crate::formatter::FormatConfigError;
use crate::formatter::format::{Format, FormatError};
use platform_dirs::AppDirs;
use rust_embed::RustEmbed;
use serde::Deserialize;
use std::fs::{read_dir, File};
use std::fs::{File, read_dir};
use std::io::Read;
use std::path::PathBuf;
use std::{fs, str};