mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
ignore roxygen2-generated files (#3373)
This commit is contained in:
committed by
Brandon Black
parent
8f2820e9cc
commit
1c4baf6dc2
@@ -77,7 +77,8 @@ module Linguist
|
||||
generated_unity3d_meta? ||
|
||||
generated_racc? ||
|
||||
generated_jflex? ||
|
||||
generated_grammarkit?
|
||||
generated_grammarkit? ||
|
||||
generated_roxygen2?
|
||||
end
|
||||
|
||||
# Internal: Is the blob an Xcode file?
|
||||
@@ -433,5 +434,19 @@ module Linguist
|
||||
return false unless lines.count > 1
|
||||
return lines[0].start_with?("// This is a generated file. Not intended for manual editing.")
|
||||
end
|
||||
|
||||
# Internal: Is this a roxygen2-generated file?
|
||||
#
|
||||
# A roxygen2-generated file typically contain:
|
||||
# % Generated by roxygen2: do not edit by hand
|
||||
# on the first line.
|
||||
#
|
||||
# Return true or false
|
||||
def generated_roxygen2?
|
||||
return false unless extname == '.Rd'
|
||||
return false unless lines.count > 1
|
||||
|
||||
return lines[0].include?("% Generated by roxygen2: do not edit by hand")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user