Skip to content

Commit

Permalink
chore: Move lint rules from lints.toml to Cargo.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
sirewix committed Jul 4, 2024
1 parent 43ace36 commit cc2e8f8
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 99 deletions.
89 changes: 89 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,92 @@ rustls-pemfile = { version = "1.0.3" }
[dev-dependencies]
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }
serial_test = "2"

[lints.rust]
dead_code = "warn"
missing_debug_implementations = "warn"
missing_docs = "warn"
trivial_casts = "warn"
trivial_numeric_casts = "warn"
unused_extern_crates = "warn"
unused_import_braces = "warn"
unused_qualifications = "warn"

[lints.clippy]
tabs_in_doc_comments = "allow"
branches_sharing_code = "warn"
cast_lossless = "warn"
cast_possible_wrap = "warn"
checked_conversions = "warn"
cloned_instead_of_copied = "warn"
create_dir = "warn"
dbg_macro = "warn"
default_trait_access = "warn"
expect_used = "warn"
expl_impl_clone_on_copy = "warn"
fallible_impl_from = "warn"
filetype_is_file = "warn"
filter_map_next = "warn"
flat_map_option = "warn"
float_cmp = "warn"
fn_params_excessive_bools = "warn"
fn_to_numeric_cast_any = "warn"
future_not_send = "warn"
if_then_some_else_none = "warn"
implicit_clone = "warn"
implicit_hasher = "warn"
implicit_saturating_sub = "warn"
imprecise_flops = "warn"
inefficient_to_string = "warn"
items_after_statements = "warn"
iter_not_returning_iterator = "warn"
large_digit_groups = "warn"
large_stack_arrays = "warn"
large_types_passed_by_value = "warn"
lossy_float_literal = "warn"
macro_use_imports = "warn"
manual_let_else = "warn"
manual_ok_or = "warn"
many_single_char_names = "warn"
map_unwrap_or = "warn"
mem_forget = "warn"
missing_docs_in_private_items = "warn"
must_use_candidate = "warn"
mut_mut = "warn"
mutex_atomic = "warn"
needless_bitwise_bool = "warn"
non_send_fields_in_send_ty = "warn"
option_option = "warn"
path_buf_push_overwrite = "warn"
print_stderr = "warn"
print_stdout = "warn"
ptr_as_ptr = "warn"
range_minus_one = "warn"
range_plus_one = "warn"
rc_buffer = "warn"
rc_mutex = "warn"
redundant_closure_for_method_calls = "warn"
ref_binding_to_reference = "warn"
ref_option_ref = "warn"
return_self_not_must_use = "warn"
same_functions_in_if_condition = "warn"
same_name_method = "warn"
semicolon_if_nothing_returned = "warn"
str_to_string = "warn"
string_to_string = "warn"
suboptimal_flops = "warn"
suspicious_operation_groupings = "warn"
too_many_lines = "warn"
trait_duplication_in_bounds = "warn"
trivially_copy_pass_by_ref = "warn"
type_repetition_in_bounds = "warn"
undocumented_unsafe_blocks = "warn"
unnested_or_patterns = "warn"
unreadable_literal = "warn"
unseparated_literal_suffix = "warn"
unused_async = "warn"
unused_self = "warn"
unwrap_used = "warn"
used_underscore_binding = "warn"
useless_let_if_seq = "warn"
verbose_file_reads = "warn"
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ while let Some(entry) = receiver.recv().await {

## Testing

This library has two test modes: mock and integration tests. To run the mock tests without additional dependencies:
This library has two test modes: mock and integration tests. To run the mock tests without additional dependencies:

```
cargo test
Expand All @@ -90,7 +90,7 @@ The docker compose files are in `docker-compose/`. To run the integration tests,
```
cargo make start-docker-setup
cargo test -- --ignored
cargo make stop-docker-setup
cargo make stop-docker-setup
```


Expand Down Expand Up @@ -132,7 +132,7 @@ file within the repository.

If you compile the open source software that we make available to develop your
own mobile, desktop or embeddable application, and cause that application to
connect to our servers for any purposes, you have to aggree to our Terms of
connect to our servers for any purposes, you have to agree to our Terms of
Service. In short, if you choose to connect to our servers, certain restrictions
apply as follows:

Expand Down
92 changes: 0 additions & 92 deletions lints.toml

This file was deleted.

2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ mod tests {
.await
.err()
.unwrap(),
crate::error::Error::Invalid(_)
error::Error::Invalid(_)
));

// invalid path test
Expand Down
6 changes: 3 additions & 3 deletions tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ async fn ldap_user_sync_modification_test() -> Result<(), Box<dyn Error>> {
}
}

tokio::time::sleep(tokio::time::Duration::from_secs(3)).await;
tokio::time::sleep(Duration::from_secs(3)).await;

assert_eq!(users.len(), 1);
assert_eq!(users[0].attr_first("displayName").unwrap(), "MyName1");
Expand All @@ -275,7 +275,7 @@ async fn ldap_user_sync_modification_test() -> Result<(), Box<dyn Error>> {
assert_eq!(users[0].attr_first("displayName").unwrap(), "MyName1");
assert_eq!(users[1].attr_first("displayName").unwrap(), "MyNameNew");

tokio::time::sleep(tokio::time::Duration::from_secs(1)).await;
tokio::time::sleep(Duration::from_secs(1)).await;

ldap_user_add_attribute(&mut ldap, "user01", "employeeType", "FALSE").await?;

Expand All @@ -291,7 +291,7 @@ async fn ldap_user_sync_modification_test() -> Result<(), Box<dyn Error>> {
assert_eq!(users.len(), 3);
assert_eq!(users[2].bool_first("employeeType").unwrap().unwrap(), false);

tokio::time::sleep(tokio::time::Duration::from_secs(1)).await;
tokio::time::sleep(Duration::from_secs(1)).await;

ldap_user_replace_attribute(&mut ldap, "user01", "employeeType", "TRUE").await?;

Expand Down

0 comments on commit cc2e8f8

Please sign in to comment.