Commit Graph

51 Commits

Author SHA1 Message Date
S0AndS0 432fd9443e WIP: Add the "unwrap_used" lint.
> Check `unwrap_used` section of Clippy documentation for details;
>
>   https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used

This adds the following Clippy configuration to crates;

    #![deny(clippy::unwrap_used)]

**Warning** while tests and compiler do not show any errors, the submitted
changes are very much a Work In Progress and mistakes may have been made. Check

    https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/67

Merge Request thread for more details.
2021-08-24 15:31:31 -07:00
Nick Mathewson fe5d826942 Merge remote-tracking branch 'origin/mr/60' 2021-08-18 08:53:11 -04:00
S0AndS0 484cc24856 Add the "implicit_clone" lint.
> Check `implicit_clone` section of Clippy documentation for details;
>
>   https://rust-lang.github.io/rust-clippy/master/index.html#implicit_clone

This adds, and addresses, the following Clippy configuration to crates;

    #![deny(clippy::implicit_clone)]

And moves related line within `maint/add_warning.py` file. My intent is to
mitigate extra edits after merging, so please let me know if I need to do this
last bit differently.
2021-08-17 11:49:39 -07:00
S0AndS0 b5a58f5871 Add the "missing_panics_doc" lint.
> Check `missing_panics_doc` section of Clippy documentation for details;
>
>   https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc

This adds the following Clippy configuration to crates;

    #![deny(clippy::missing_panics_doc)]

And adds necessary doc-comments to methods that may panic.
2021-08-13 15:11:04 -07:00
Nick Mathewson 9c6dd27ca1 Use add_warnings.py for clippy::cast_lossless 2021-08-13 11:36:14 -04:00
S0AndS0 657e7b2246 Add the "cast_lossless" lint.
> Check `cast_lossless` section of Clippy documentation for details;
>
>   https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless

This adds the following Clippy configuration to crates;

    #![deny(clippy::cast_lossless)]

And applies suggested Clippy and `cargo fmt` fixes.
2021-08-12 17:25:15 -07:00
Nick Mathewson 79d9eac58c Add unnecessary_wraps to the big warning list. 2021-08-06 16:20:37 -04:00
rls 51d91508f7 Fix typos and other spelling mistakes 2021-07-31 18:02:35 +02:00
Nick Mathewson a2ca2222b8 Merge remote-tracking branch 'origin/mr/42' 2021-07-21 09:42:16 -04:00
Daniel Eades d23256074e address a bunch of hopefully uncontroversial lints 2021-07-20 22:59:59 +01:00
Trinity Pointard 594b65fff6 switch to maintained crates for memmap and tmpdir
They don't have actual documented security issues but it makes
`cargo audit` complain

https://rustsec.org/advisories/RUSTSEC-2018-0017
https://rustsec.org/advisories/RUSTSEC-2020-0077
2021-07-20 23:35:17 +02:00
Nick Mathewson 1c21295d19 Merge remote-tracking branch 'origin/mr/34' 2021-06-27 14:30:49 -04:00
Nick Mathewson adc611dc72 Fix category in tor-config/Cargo.toml 2021-06-24 10:45:43 -04:00
Nick Mathewson b774360755 Remove "publish = false" 2021-06-24 07:04:26 -04:00
YUAN LYU 92dbf20a76 Add clippy warn needless pass by value 2021-06-21 23:27:19 -04:00
YUAN LYU b830e81b7f Add clippy warn needless borrow 2021-06-21 21:34:40 -04:00
Nick Mathewson 2102d2e2b5 Add noop_method_call warning.
This would have saved ahf and me a lot of confusion in debugging a
situation where we were cloning a reference of a type that didn't
implement Clone.
2021-05-27 14:32:29 -04:00
Nick Mathewson 745c90e92c Enable cargo_common_metadata warning. 2021-05-25 15:42:47 -04:00
Nick Mathewson cf59e9be77 Add automatically generated README.md files to each crate. 2021-05-25 15:41:23 -04:00
Nick Mathewson 61c62548a5 Module docs for remaining crates 2021-05-25 15:40:02 -04:00
Nick Mathewson ce6702a147 Give every Cargo.toml a repository field 2021-05-19 14:56:09 -04:00
Nick Mathewson 712e6ec23c Fill in "package.categories" on all Cargo.toml 2021-05-19 14:50:39 -04:00
Nick Mathewson 411e1b35e0 Add the "unreachable_pub" lint.
This is a somewhat obnoxious change in its scope and requirements,
but it makes it easier to understand what the real public and
private parts of our APIs are.
2021-05-18 13:45:39 -04:00
Nick Mathewson e01f227191 Resolve clippy warnings from Rust 1.52.
Rust 1.52 just came out, and there are new clippy lints to deal
with:

   * It spots more cases when we could use Option::map
   * It spots more cases when we could use Iterator::flatten
   * When we build a struct instance, it wants us to list the fields
     in the same order that the struct declares them.
2021-05-07 15:53:17 -04:00
Nick Mathewson 8eb36cbfff Add trait_duplication_in_bounds warning. 2021-05-03 16:30:27 -04:00
Nick Mathewson d516298b47 Add unseparated_literal_suffix lint, and fix it. 2021-05-03 16:19:01 -04:00
Nick Mathewson 9737580402 Add a few more clippy warnings 2021-05-03 16:10:39 -04:00
Nick Mathewson b254158354 Bump regex and memchr versions 2021-05-03 09:19:19 -04:00
Nick Mathewson 94c93c9121 Add some more clippy warnings to our list. 2021-04-27 14:51:04 -04:00
Nick Mathewson 2e3780affb Enforce (and obey) clippy lints about exhaustive enums, structs.
These lints force us to declare our exported enums and
exhaustive-looking structs as non-exhaustive (so that we can add to
them in the future without breaking our API) or to explicitly
disable the warning for a given enum/struct (to say that we _intend_
for additions to be a breaking change).
2021-04-27 14:17:49 -04:00
Nick Mathewson adefe60f60 upgrade httparse and zeroize 2021-04-25 12:39:35 -04:00
Nick Mathewson 4b0f3f6a35 More tests in tor-config 2021-04-21 10:59:28 -04:00
Nick Mathewson 6cc8e5e028 Remove a few unused dependencies 2021-04-05 08:20:06 -04:00
Nick Mathewson 401d7e9fd1 tor-config: fix a new clipppy warning. 2021-03-29 15:45:50 -04:00
Nick Mathewson 06d5988cdc upgrade to newer version of config crate. 2021-03-24 09:44:31 -04:00
Nick Mathewson 6daf57957d Add the tor project as an author. 2021-03-17 14:43:40 -04:00
Nick Mathewson ba14d43be4 Add keywords to each Cargo.toml 2021-03-17 14:41:02 -04:00
Nick Mathewson c8481a9354 Add a description field to all our Cargo.toml files 2021-03-17 14:31:59 -04:00
Nick Mathewson 58d8472ea0 Give it a homepage everyplace. 2021-03-17 14:13:26 -04:00
Nick Mathewson 442d3d7f89 Allow spaces in command-line arguments again 2021-03-12 13:21:44 -05:00
Nick Mathewson 49b508e5cc Avoid most regex features. 2021-03-10 16:05:33 -05:00
Nick Mathewson 9d07f4160f Only enable the `config` features we are using.
This saves us from a lot of extra backends, including an entire
extra version of serde (!).
2021-03-10 15:46:06 -05:00
Nick Mathewson 302653977d Bump dependencies with "cargo upgrade" 2021-03-06 08:55:13 -05:00
Nick Mathewson 59bfa4d517 Avoid unwrap() in tor-config 2021-03-04 12:51:11 -05:00
Nick Mathewson 568567c5e0 Update to latest futures, once_cell 2021-02-23 15:54:29 -05:00
Nick Mathewson ab9d4a2229 Update some dependencies. 2021-02-19 09:39:23 -05:00
Nick Mathewson c9b9286fa9 Add some tests for tor_config::CfgPath 2021-02-12 13:13:57 -05:00
Nick Mathewson d8c1e7f0cf Implement storage-directory configuration.
This affects the cache_dir and the as-yet-unused state_dir.  It uses
the shellexpand and directories crates so that the default values
can be constant strings that use variables to refer to the right
default locations.
2021-02-12 10:54:24 -05:00
Nick Mathewson 66ffa44512 Initial support for configuration from file and/or command-line. 2021-02-02 13:26:02 -05:00
Nick Mathewson 243880473f bump serde and log 2021-02-01 16:39:07 -05:00