release v0.3.4 🥳
This commit is contained in:
parent
ddde6acdd6
commit
0404cff8b7
7 changed files with 18 additions and 18 deletions
|
@ -2,7 +2,7 @@
|
||||||
Dates are given in YYYY-MM-DD format.
|
Dates are given in YYYY-MM-DD format.
|
||||||
|
|
||||||
## v0.3
|
## v0.3
|
||||||
### v0.3.4 (2021-mm-dd)
|
### v0.3.4 (2021-08-07)
|
||||||
#### Features
|
#### Features
|
||||||
- Added `-I`/`--ignore-unknown-exts` flag for ignoring files with unknown extensions - for example, if fif doesn't know
|
- Added `-I`/`--ignore-unknown-exts` flag for ignoring files with unknown extensions - for example, if fif doesn't know
|
||||||
what a ".fake" file is, setting this flag will prevent it from renaming "photo.fake" to "photo.jpg". This is useful
|
what a ".fake" file is, setting this flag will prevent it from renaming "photo.fake" to "photo.jpg". This is useful
|
||||||
|
|
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -1,7 +1,5 @@
|
||||||
# This file is automatically @generated by Cargo.
|
# This file is automatically @generated by Cargo.
|
||||||
# It is not intended for manual editing.
|
# It is not intended for manual editing.
|
||||||
version = 3
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "arrayvec"
|
name = "arrayvec"
|
||||||
version = "0.5.2"
|
version = "0.5.2"
|
||||||
|
@ -185,7 +183,7 @@ checksum = "de853764b47027c2e862a995c34978ffa63c1501f2e15f987ba11bd4f9bba193"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fif"
|
name = "fif"
|
||||||
version = "0.3.3"
|
version = "0.3.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cached",
|
"cached",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "fif"
|
name = "fif"
|
||||||
description = "A command-line tool for detecting and optionally correcting files with incorrect extensions."
|
description = "A command-line tool for detecting and optionally correcting files with incorrect extensions."
|
||||||
version = "0.3.3"
|
version = "0.3.4"
|
||||||
authors = ["Lynnesbian <lynne@bune.city>"]
|
authors = ["Lynnesbian <lynne@bune.city>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
license = "GPL-3.0-or-later"
|
license = "GPL-3.0-or-later"
|
||||||
|
|
|
@ -32,6 +32,8 @@ for backend in "${_backends[@]}"; do
|
||||||
-A clippy::shadow_unrelated \
|
-A clippy::shadow_unrelated \
|
||||||
-A clippy::option_if_let_else \
|
-A clippy::option_if_let_else \
|
||||||
-A clippy::multiple-crate-versions \
|
-A clippy::multiple-crate-versions \
|
||||||
|
-A clippy::cast-possible-truncation \
|
||||||
|
-A clippy::cast-possible-wrap \
|
||||||
"$_extra"
|
"$_extra"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -41,3 +43,5 @@ done
|
||||||
# shadow_unrelated: sometimes things that seem unrelated are actually related ;)
|
# shadow_unrelated: sometimes things that seem unrelated are actually related ;)
|
||||||
# option_if_let_else: the suggested code is usually harder to read than the original
|
# option_if_let_else: the suggested code is usually harder to read than the original
|
||||||
# multiple_crate_versions: cached uses an old version of hashbrown :c
|
# multiple_crate_versions: cached uses an old version of hashbrown :c
|
||||||
|
# cast-possible-truncation: only ever used where it would be totally fine
|
||||||
|
# cast-possible-wrap: ditto
|
||||||
|
|
|
@ -33,8 +33,8 @@ use crate::formats::Format;
|
||||||
use crate::mime_db::MimeDb;
|
use crate::mime_db::MimeDb;
|
||||||
use crate::parameters::{OutputFormat, ScanOpts};
|
use crate::parameters::{OutputFormat, ScanOpts};
|
||||||
use crate::utils::{clap_long_version, os_name};
|
use crate::utils::{clap_long_version, os_name};
|
||||||
use std::collections::BTreeSet;
|
|
||||||
use mime_guess::from_ext;
|
use mime_guess::from_ext;
|
||||||
|
use std::collections::BTreeSet;
|
||||||
|
|
||||||
mod findings;
|
mod findings;
|
||||||
mod formats;
|
mod formats;
|
||||||
|
@ -218,12 +218,10 @@ fn wanted_file(
|
||||||
let ext = ext.to_string_lossy().to_lowercase();
|
let ext = ext.to_string_lossy().to_lowercase();
|
||||||
let ext = ext.as_str();
|
let ext = ext.as_str();
|
||||||
|
|
||||||
if scan_opts.ignore_unknown_exts {
|
if scan_opts.ignore_unknown_exts && from_ext(ext).is_empty() {
|
||||||
if from_ext(ext).is_empty() {
|
|
||||||
// unknown extension, skip.
|
// unknown extension, skip.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(exts) = exts {
|
if let Some(exts) = exts {
|
||||||
// only scan if the file has one of the specified extensions.
|
// only scan if the file has one of the specified extensions.
|
||||||
|
|
|
@ -145,6 +145,7 @@ fn lowercase_exts(exts: &str) -> Result<(), String> {
|
||||||
|
|
||||||
/// Further options relating to scanning.
|
/// Further options relating to scanning.
|
||||||
#[derive(PartialEq, Debug)]
|
#[derive(PartialEq, Debug)]
|
||||||
|
#[allow(clippy::struct_excessive_bools)]
|
||||||
pub struct ScanOpts {
|
pub struct ScanOpts {
|
||||||
/// Whether hidden files and directories should be scanned.
|
/// Whether hidden files and directories should be scanned.
|
||||||
pub hidden: bool,
|
pub hidden: bool,
|
||||||
|
@ -221,7 +222,7 @@ impl Parameters {
|
||||||
hidden: self.scan_hidden,
|
hidden: self.scan_hidden,
|
||||||
extensionless: self.scan_extensionless,
|
extensionless: self.scan_extensionless,
|
||||||
follow_symlinks: self.follow_symlinks,
|
follow_symlinks: self.follow_symlinks,
|
||||||
ignore_unknown_exts: self.ignore_unknown_exts
|
ignore_unknown_exts: self.ignore_unknown_exts,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -333,7 +333,10 @@ fn identify_random_bytes() {
|
||||||
for (mime, count) in &results {
|
for (mime, count) in &results {
|
||||||
println!("{}:\t{} counts", mime, count);
|
println!("{}:\t{} counts", mime, count);
|
||||||
}
|
}
|
||||||
println!("No type found:\t{} counts", results.values().len() as i32 - results.values().sum::<i32>());
|
println!(
|
||||||
|
"No type found:\t{} counts",
|
||||||
|
results.values().len() as i32 - results.values().sum::<i32>()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -433,11 +436,7 @@ fn writables_is_correct() {
|
||||||
use crate::writables;
|
use crate::writables;
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
&[
|
&["henlo".into(), Path::new("henlo").into(), Writable::Newline,],
|
||||||
"henlo".into(),
|
|
||||||
Path::new("henlo").into(),
|
|
||||||
Writable::Newline,
|
|
||||||
],
|
|
||||||
writables!["henlo", (Path::new("henlo")), Newline]
|
writables!["henlo", (Path::new("henlo")), Newline]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue