diff --git a/scripts/clippy.sh b/scripts/clippy.sh deleted file mode 100644 index b4a6f43..0000000 --- a/scripts/clippy.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) -# Goto the root of the project -cd "$SCRIPT_DIR" || exit - -cargo +nightly clippy --all --all-features --allow-dirty --no-deps --tests --examples --benches -- -Z macro-backtrace \ - -D clippy::all \ - -D clippy::pedantic \ - -W clippy::similar_names \ - -A clippy::type_repetition_in_bounds \ - -A clippy::missing-errors-doc \ - -A clippy::cast-possible-truncation \ - -A clippy::used-underscore-binding \ - -A clippy::ptr-as-ptr \ - -A clippy::missing-panics-doc \ - -A clippy::missing-docs-in-private-items \ - -A clippy::unseparated-literal-suffix \ - -A clippy::module-name-repetitions \ - -A clippy::unreadable-literal - -echo "Clippy executed" \ No newline at end of file diff --git a/scripts/clippy_fix_fmt.sh b/scripts/clippy_fix_fmt.sh new file mode 100644 index 0000000..4c0e4fe --- /dev/null +++ b/scripts/clippy_fix_fmt.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# Inspired from LibAFL scripts + +SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) +# Goto the root of the project +cd "$SCRIPT_DIR" || exit +echo "Use --no-clean if you don't want to 'cargo clean' Phink" +if [ "$1" != "--no-clean" ]; then + # Usually, we want to clean, since clippy won't work otherwise. + echo "[+] Cleaning up previous builds..." + cargo clean -p phink +fi +echo + +echo "[+] Fixing build" +cargo +nightly fix --release --workspace --all-features --allow-dirty --allow-staged + +echo "[+] Done fixing build" +echo + +echo 'Fixing clippy (might need a "git commit" and a rerun, if "cargo fix" changed the source)' +RUST_BACKTRACE=full cargo +nightly clippy --fix --release --all --all-features --tests --examples --benches --allow-dirty --allow-staged -- -Z macro-backtrace \ + -D clippy::all \ + -D clippy::pedantic \ + -W clippy::similar_names \ + -A clippy::type_repetition_in_bounds \ + -A clippy::missing-errors-doc \ + -A clippy::cast-possible-truncation \ + -A clippy::used-underscore-binding \ + -A clippy::ptr-as-ptr \ + -A clippy::missing-panics-doc \ + -A clippy::missing-docs-in-private-items \ + -A clippy::unseparated-literal-suffix \ + -A clippy::module-name-repetitions \ + -A clippy::unreadable-literal \ + +cargo +nightly clippy --fix --tests --examples --benches --all-features --allow-dirty --allow-staged + +echo "[+] Done fixing clippy" +echo + +echo "[+] Formatting all" + +cargo +nightly fmt --all || exit 1 \ No newline at end of file diff --git a/src/cli/ziggy.rs b/src/cli/ziggy.rs index 9a1221f..5047511 100644 --- a/src/cli/ziggy.rs +++ b/src/cli/ziggy.rs @@ -17,13 +17,11 @@ use std::{ use std::{ io::{ self, - Read, }, process::{ Command, Stdio, }, - sync::mpsc, }; use crate::cli::config::{ @@ -34,24 +32,7 @@ use crate::cli::config::{ }, PhinkFiles, }; -use crossterm::{ - event::{ - self, - DisableMouseCapture, - EnableMouseCapture, - Event, - KeyCode, - }, - execute, - terminal::{ - disable_raw_mode, - enable_raw_mode, - EnterAlternateScreen, - LeaveAlternateScreen, - }, -}; use ratatui::{ - backend::CrosstermBackend, layout::{ Constraint, Direction, @@ -59,7 +40,6 @@ use ratatui::{ }, style::{ Color, - Modifier, Style, }, text::{ @@ -72,7 +52,6 @@ use ratatui::{ Paragraph, }, Frame, - Terminal, }; enum AppEvent {