[tor-bugs] #22156 [Core Tor/Tor]: Add Rust linting/formatting tools

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed May 31 03:16:19 UTC 2017


#22156: Add Rust linting/formatting tools
--------------------------+----------------------------------
 Reporter:  chelseakomlo  |          Owner:
     Type:  enhancement   |         Status:  new
 Priority:  Medium        |      Milestone:  Tor: unspecified
Component:  Core Tor/Tor  |        Version:
 Severity:  Normal        |     Resolution:
 Keywords:  rust          |  Actual Points:
Parent ID:                |         Points:
 Reviewer:                |        Sponsor:
--------------------------+----------------------------------

Comment (by hdevalence):

 `cargo clippy` is a great tool, but I don't think that it should be part
 of a CI run, and I don't think that it makes sense (or is worthwhile) to
 spend time deciding which rules should be included or not.

 The reason is that `cargo clippy` is meant to be **extremely
 enthusiastic** about giving suggestions.  Often, these suggestions are
 helpful, but sometimes, they aren't.  And, for a given rule, there's no
 way to know whether it will always be useful or not (i.e., there's no way
 to decide in advance whether it should be "required").  For instance,
 consider [https://github.com/Manishearth/rust-
 clippy/wiki#needless_range_loop `needless_range_loop`].  This is often a
 good warning, but sometimes it really does make more sense to use an
 explicit index.  There's no way to know, except by using context and
 judgement.

 I wonder whether a focus on requiring linting tools as part of a
 development/CI process is a legacy from C development.  Since `rustc`
 already includes quite extensive errors and warnings, is a required
 linting process beyond "no warnings on compilation" necessary?

 To put it another way, what errors are people hoping to catch using a
 linter that `rustc` wouldn't already warn about?

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/22156#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list