-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17588 from geoffw0/loc2
Rust: Improve lines-of-code counts.
- Loading branch information
Showing
9 changed files
with
79 additions
and
18 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
@@ -1 +1 @@ | ||
| 48 | | ||
| 61 | |
This file contains 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 |
---|---|---|
@@ -1 +1 @@ | ||
| 48 | | ||
| 61 | |
9 changes: 5 additions & 4 deletions
9
rust/ql/test/query-tests/diagnostics/LinesOfUserCodeInFiles.expected
This file contains 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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
| my_struct.rs:0:0:0:0 | my_struct.rs | 21 | | ||
| my_macro.rs:0:0:0:0 | my_macro.rs | 8 | | ||
| main.rs:0:0:0:0 | main.rs | 7 | | ||
| lib.rs:0:0:0:0 | lib.rs | 6 | | ||
| my_struct.rs:0:0:0:0 | my_struct.rs | 20 | | ||
| comments.rs:0:0:0:0 | comments.rs | 13 | | ||
| main.rs:0:0:0:0 | main.rs | 8 | | ||
| lib.rs:0:0:0:0 | lib.rs | 7 | | ||
| my_macro.rs:0:0:0:0 | my_macro.rs | 7 | | ||
| does_not_compile.rs:0:0:0:0 | does_not_compile.rs | 3 | | ||
| error.rs:0:0:0:0 | error.rs | 3 | |
This file contains 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
| Elements extracted | 210 | | ||
| Elements extracted | 290 | | ||
| Elements unextracted | 0 | | ||
| Files extracted | 6 | | ||
| Lines of code extracted | 48 | | ||
| Lines of user code extracted | 48 | | ||
| Files extracted | 7 | | ||
| Lines of code extracted | 61 | | ||
| Lines of user code extracted | 61 | |
This file contains 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,60 @@ | ||
/** | ||
* total lines in this file: 61 | ||
* of which code: 16 | ||
* of which only comments: 33 | ||
* of which blank: 12 | ||
*/ | ||
|
||
// a comment | ||
|
||
/** | ||
* Comment attached to a struct. | ||
*/ | ||
struct StructWithComments | ||
{ | ||
/** | ||
* Another attached comment. | ||
*/ | ||
a: i32, | ||
|
||
// And another attached comment. | ||
b: i32, | ||
|
||
/* | ||
* And yet another attached comment. | ||
*/ | ||
c: i32, | ||
|
||
// informal | ||
// comment | ||
// block. | ||
cd: i32, | ||
|
||
// Just a comment. | ||
} | ||
|
||
pub fn my_simple_func() | ||
{ | ||
} | ||
|
||
/** | ||
* Comment attached to a function. | ||
*/ | ||
pub fn my_func_with_comments() | ||
{ | ||
// comment | ||
let a = 1; // comment | ||
// comment | ||
let b = 2; | ||
|
||
// comment | ||
|
||
/* | ||
* Comment. | ||
*/ | ||
my_simple_func(); | ||
} | ||
|
||
/* | ||
* Comment. | ||
*/ |
This file contains 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 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