[#3808] flag ppport.h files created by Devel::PPPort perl module as generated#4106
[#3808] flag ppport.h files created by Devel::PPPort perl module as generated#4106lildude merged 2 commits intogithub-linguist:masterfrom ioanrogers:perl-generated-ppport.h
Conversation
lib/linguist/generated.rb
Outdated
There was a problem hiding this comment.
Why 10? Is that arbitrary?
There was a problem hiding this comment.
The string match in the next test is on line 9, so it's just to make sure the file is at least that long.
There was a problem hiding this comment.
Ah, ok. I guess I was expecting >= 9 or a higher number for the whole header comment.
lib/linguist/generated.rb
Outdated
There was a problem hiding this comment.
AFAICT, yes
https://github.com/mhx/Devel-PPPort/blame/d7849d96015b66d69606488aa65877dc2ba737a4/PPPort_pm.PL#L585
The git history goes back to 2012.
There was a problem hiding this comment.
I think in that case we can probably skip the lines.count > 10 check.
There was a problem hiding this comment.
In Perl, if you try to perform a match against something which is undefined you will get a warning.
I don't know Ruby - does the include call handle array elements which don't exist?
There was a problem hiding this comment.
Okay, I just checked with a truncated file and it seemed ok.
I forgot to take out the check before running the test on a truncated file. It does indeed give a warning:
TestGenerated#test_check_generated:
NoMethodError: undefined method `include?' for nil:NilClass
/home/ioanrogers/Projects/PUBLIC_GITHUB/linguist/lib/linguist/generated.rb:543:in `generated_perl_ppport_header?'
/home/ioanrogers/Projects/PUBLIC_GITHUB/linguist/lib/linguist/generated.rb:89:in `generated?'
/home/ioanrogers/Projects/PUBLIC_GITHUB/linguist/lib/linguist/generated.rb:12:in `generated?'
/home/ioanrogers/Projects/PUBLIC_GITHUB/linguist/test/test_generated.rb:20:in `generated_loading_data'
/home/ioanrogers/Projects/PUBLIC_GITHUB/linguist/test/test_generated.rb:28:in `generated_fixture_loading_data'
/home/ioanrogers/Projects/PUBLIC_GITHUB/linguist/test/test_generated.rb:123:in `test_check_generated'
|
This is looking good from my perspective, except for the heeeaaawwg Thoughts? |
|
Done |
lildude
left a comment
There was a problem hiding this comment.
LGTM. Thanks for the PR and welcome to Linguist.
Marking
ppport.hfiles which are generated by Devel::PPPort as generated.Checklist: