Skip to content

Commit

Permalink
clippy & fix in bash
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-valerio committed Sep 2, 2024
1 parent 09d2901 commit ed21423
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 43 deletions.
22 changes: 0 additions & 22 deletions scripts/clippy.sh

This file was deleted.

44 changes: 44 additions & 0 deletions scripts/clippy_fix_fmt.sh
Original file line number Diff line number Diff line change
@@ -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
21 changes: 0 additions & 21 deletions src/cli/ziggy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ use std::{
use std::{
io::{
self,
Read,
},
process::{
Command,
Stdio,
},
sync::mpsc,
};

use crate::cli::config::{
Expand All @@ -34,32 +32,14 @@ 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,
Layout,
},
style::{
Color,
Modifier,
Style,
},
text::{
Expand All @@ -72,7 +52,6 @@ use ratatui::{
Paragraph,
},
Frame,
Terminal,
};

enum AppEvent {
Expand Down

0 comments on commit ed21423

Please sign in to comment.