-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Adding lint test for excessive LOC. #2857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
1169066
Adding lint for too many lines.
6b86c3b
Updating number of lines for the failing test to be > 100.
93bf74a
Running util/dev to update README/CHANGELOG
7fbd55c
Reworking function logic, and adding doc example.
3a97b5f
Moving tests to ui-toml to make use of clippy.toml
e583f35
rustfmt
c1f4e18
Adding back tests, but also reducing threshold by 1
50c82e0
Updating to just warn for one test.
0245620
Fix test broken by removing comment.
44c835f
Skipping check if in external macro.
5e10809
Adding lint for too many lines.
be514a4
Updating number of lines for the failing test to be > 100.
65f62d0
Moving tests to ui-toml to make use of clippy.toml
6931b0f
rustfmt
057037a
Adding back tests, but also reducing threshold by 1
ae3bcb7
Updating to just warn for one test.
21e2b13
Fix test broken by removing comment.
93a856e
Changing single character string to a character match.
a35083f
Updated readme.
6e35b33
Updating code to ignore rustfmt issue.
a022d47
Update clippy_lints/src/types.rs
phansch ac9472d
Update clippy_lints/src/types.rs
phansch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
too-many-lines-threshold = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#![warn(clippy::too_many_lines)] | ||
|
||
// This function should be considered one line. | ||
fn many_comments_but_one_line_of_code() { | ||
/* println!("This is good."); */ | ||
// println!("This is good."); | ||
/* */ // println!("This is good."); | ||
/* */ // println!("This is good."); | ||
/* */ // println!("This is good."); | ||
/* */ // println!("This is good."); | ||
/* println!("This is good."); | ||
println!("This is good."); | ||
println!("This is good."); */ | ||
println!("This is good."); | ||
} | ||
|
||
// This should be considered two and a fail. | ||
fn too_many_lines() { | ||
println!("This is bad."); | ||
println!("This is bad."); | ||
} | ||
|
||
// This should be considered one line. | ||
#[rustfmt::skip] | ||
fn comment_starts_after_code() { | ||
let _ = 5; /* closing comment. */ /* | ||
this line shouldn't be counted theoretically. | ||
*/ | ||
} | ||
|
||
// This should be considered one line. | ||
fn comment_after_code() { | ||
let _ = 5; /* this line should get counted once. */ | ||
} | ||
|
||
// This should fail since it is technically two lines. | ||
#[rustfmt::skip] | ||
fn comment_before_code() { | ||
let _ = "test"; | ||
/* This comment extends to the front of | ||
teh code but this line should still count. */ let _ = 5; | ||
} | ||
|
||
// This should be considered one line. | ||
fn main() {} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.