]> git.lizzy.rs Git - rust.git/commit
Auto merge of #2857 - avborhanian:master, r=phansch
authorbors <bors@rust-lang.org>
Sat, 2 Feb 2019 08:32:27 +0000 (08:32 +0000)
committerbors <bors@rust-lang.org>
Sat, 2 Feb 2019 08:32:27 +0000 (08:32 +0000)
commit27b5dd8886ac0423e059c0817b55a4e618b344a0
treef98cc9bf3abea6c99809a9aaf8cb8a54348e15c9
parent9f886414505cce50eae02fb241b83701dc61c837
parentac9472d16e5eee8b5cdf3adaf83b8ba5fdd354cd
Auto merge of #2857 - avborhanian:master, r=phansch

Adding lint test for excessive LOC.

This is a WIP for #2377. Just wanted to pull in because I had a few questions:

1. Is it okay that I'm approaching this via counting by looking at each line in the snippet instead of looking at the AST tree? If there's another way to do it, I want to make sure I'm doing the correct way, but I wasn't sure since the output AST JSON doesn't seem to contain whitespace.

2. My function is definitely going to trigger the lint, so also wanted to see if there was something obvious I could do to reduce it.

3. Are the two tests fine, or is there something obvious I'm missing?

4. Obviously bigger question - am I approaching the line count correctly. Current strategy is count a line if it contains some code, so skip if it's just comments or empty.
clippy_lints/src/types.rs