Skip to content

Commit

Permalink
add more lints (#11)
Browse files Browse the repository at this point in the history
* add more lints

* add cron job

* add test prelude

* better errors and tests for canonizalize path

* update deps

* 0.3.3
  • Loading branch information
CramBL authored Oct 19, 2024
1 parent 18937a2 commit c61ef5f
Show file tree
Hide file tree
Showing 16 changed files with 443 additions and 173 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on:
pull_request:
push:
branches: [ "master" ]
schedule:
# Run at 8 AM, on sundays
- cron: '0 8 * * 0'

name: CI

Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

## Unreleased

## [0.3.3]

### Changed

- Update dependencies

### Internals

- Refactors
- More tests

## [0.3.2]

### Added
Expand Down
35 changes: 17 additions & 18 deletions Cargo.lock

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

157 changes: 156 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "fidelityfetch"
description = "Seamlessly setup a webserver to serve files recursively from a specified path"
license = "MIT OR Apache-2.0"
authors = ["Marc Beck König <[email protected]>"]
version = "0.3.2"
version = "0.3.3"
edition = "2021"
readme = "README.md"
homepage = "https://github.com/CramBL/fidelityfetch"
Expand Down Expand Up @@ -37,9 +37,11 @@ tokio-util = { version = "0.7.12", features = ["io"] }
tokio-stream = { version = "0.1.16", features = ["fs"] }
futures-util = "0.3"
percent-encoding = "2.3"
thiserror = "1.0"

[dev-dependencies]
pretty_assertions = "1.4"
assert_matches = "1.5"
temp-dir = "0.1"
testresult = "0.4"

Expand All @@ -52,3 +54,156 @@ panic = "abort"
# The profile that 'cargo dist' will build with
[profile.dist]
inherits = "release"

[lints.rust]
missing_debug_implementations = "warn"
missing_copy_implementations = "warn"
trivial_casts = "warn"
trivial_numeric_casts = "warn"
unused_results = "warn"
unused_import_braces = "warn"
variant_size_differences = "warn"
unexpected_cfgs = "warn"
unsafe_code = "warn"

[lints.clippy]
disallowed_macros = "warn" # See clippy.toml
disallowed_methods = "warn" # See clippy.toml
disallowed_names = "warn" # See clippy.toml
disallowed_script_idents = "warn" # See clippy.toml
disallowed_types = "warn" # See clippy.toml
as_ptr_cast_mut = "warn"
await_holding_lock = "warn"
bool_to_int_with_if = "warn"
char_lit_as_u8 = "warn"
checked_conversions = "warn"
clear_with_drain = "warn"
cloned_instead_of_copied = "warn"
dbg_macro = "warn"
debug_assert_with_mut_call = "warn"
derive_partial_eq_without_eq = "warn"
doc_link_with_quotes = "warn"
doc_markdown = "warn"
empty_enum = "warn"
enum_glob_use = "warn"
equatable_if_let = "warn"
exit = "warn"
expl_impl_clone_on_copy = "warn"
explicit_deref_methods = "warn"
explicit_into_iter_loop = "warn"
explicit_iter_loop = "warn"
fallible_impl_from = "warn"
filter_map_next = "warn"
flat_map_option = "warn"
float_cmp_const = "warn"
fn_params_excessive_bools = "warn"
fn_to_numeric_cast_any = "warn"
from_iter_instead_of_collect = "warn"
get_unwrap = "warn"
if_let_mutex = "warn"
implicit_clone = "warn"
imprecise_flops = "warn"
index_refutable_slice = "warn"
inefficient_to_string = "warn"
infinite_loop = "warn"
into_iter_without_iter = "warn"
invalid_upcast_comparisons = "warn"
iter_not_returning_iterator = "warn"
iter_on_empty_collections = "warn"
iter_on_single_items = "warn"
iter_without_into_iter = "warn"
large_digit_groups = "warn"
large_include_file = "warn"
large_stack_arrays = "warn"
large_stack_frames = "warn"
large_types_passed_by_value = "warn"
let_unit_value = "warn"
linkedlist = "warn"
lossy_float_literal = "warn"
macro_use_imports = "warn"
manual_assert = "warn"
manual_clamp = "warn"
manual_instant_elapsed = "warn"
manual_let_else = "warn"
manual_ok_or = "warn"
manual_string_new = "warn"
map_err_ignore = "warn"
map_flatten = "warn"
map_unwrap_or = "warn"
match_on_vec_items = "warn"
match_same_arms = "warn"
match_wild_err_arm = "warn"
match_wildcard_for_single_variants = "warn"
mem_forget = "warn"
mismatching_type_param_order = "warn"
missing_enforced_import_renames = "warn"
missing_safety_doc = "warn"
mut_mut = "warn"
mutex_integer = "warn"
needless_borrow = "warn"
needless_continue = "warn"
needless_for_each = "warn"
needless_pass_by_ref_mut = "warn"
needless_pass_by_value = "warn"
needless_range_loop = "warn"
negative_feature_names = "warn"
nonstandard_macro_braces = "warn"
option_option = "warn"
path_buf_push_overwrite = "warn"
ptr_as_ptr = "warn"
ptr_cast_constness = "warn"
pub_without_shorthand = "warn"
rc_mutex = "warn"
readonly_write_lock = "warn"
redundant_type_annotations = "warn"
ref_option_ref = "warn"
rest_pat_in_fully_bound_structs = "warn"
same_functions_in_if_condition = "warn"
semicolon_if_nothing_returned = "warn"
should_panic_without_expect = "warn"
significant_drop_tightening = "warn"
single_match_else = "warn"
str_to_string = "warn"
string_add_assign = "warn"
string_add = "warn"
string_lit_as_bytes = "warn"
string_lit_chars_any = "warn"
string_to_string = "warn"
suspicious_command_arg_space = "warn"
suspicious_xor_used_as_pow = "warn"
todo = "warn"
too_many_lines = "warn"
trailing_empty_array = "warn"
trait_duplication_in_bounds = "warn"
tuple_array_conversions = "warn"
unchecked_duration_subtraction = "warn"
undocumented_unsafe_blocks = "warn"
unimplemented = "warn"
uninhabited_references = "warn"
uninlined_format_args = "warn"
unnecessary_box_returns = "warn"
unnecessary_safety_doc = "warn"
unnecessary_struct_initialization = "warn"
unnecessary_wraps = "warn"
unnested_or_patterns = "warn"
unused_peekable = "warn"
unused_rounding = "warn"
unused_self = "warn"
unwrap_used = "warn"
use_self = "warn"
useless_transmute = "warn"
verbose_file_reads = "warn"
wildcard_dependencies = "warn"
wildcard_imports = "warn"
zero_sized_map_values = "warn"
ref_patterns = "warn"
maybe_infinite_iter = "warn"
large_enum_variant = "warn"
shadow_unrelated = "warn"
shadow_same = "warn"
int_plus_one = "warn"
range_plus_one = "warn"
nonminimal_bool = "warn"
if_not_else = "warn"
manual_filter_map = "warn"
option_filter_map = "warn"
24 changes: 24 additions & 0 deletions clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
allow-unwrap-in-tests = true
allow-dbg-in-tests = true
max-fn-params-bools = 2
too-many-lines-threshold = 90
# https://rust-lang.github.io/rust-clippy/master/index.html#/large_include_file
max-include-file-size = 1000000

# https://rust-lang.github.io/rust-clippy/master/index.html#/large_stack_frames
stack-size-threshold = 512000


# https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_methods
disallowed-methods = [
{ path = "std::env::temp_dir", reason = "Use the tempdir crate instead" },
{ path = "std::panic::catch_unwind", reason = "We compile with `panic = 'abort'`" },
{ path = "std::thread::spawn", reason = "Use `std::thread::Builder` and name the thread" },
]

# https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_types
disallowed-types = [
{ path = "std::sync::Condvar", reason = "Use parking_lot instead" },
{ path = "std::sync::Mutex", reason = "Use parking_lot instead" },
{ path = "std::sync::RwLock", reason = "Use parking_lot instead" },
]
Loading

0 comments on commit c61ef5f

Please sign in to comment.