-
Notifications
You must be signed in to change notification settings - Fork 899
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add config option
generated_file_header_size
to specify how many li…
…nes to look at when checking for @generated
- Loading branch information
1 parent
ee2bed9
commit 673535f
Showing
3 changed files
with
6 additions
and
3 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,7 +1,7 @@ | ||
/// Returns `true` if the given span is a part of generated files. | ||
pub(super) fn is_generated_file(original_snippet: &str) -> bool { | ||
pub(super) fn is_generated_file(original_snippet: &str, header_size: usize) -> bool { | ||
original_snippet | ||
.lines() | ||
.take(5) // looking for marker only in the beginning of the file | ||
.take(header_size) // looking for marker only in the beginning of the file | ||
.any(|line| line.contains("@generated")) | ||
} |