-
Notifications
You must be signed in to change notification settings - Fork 196
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
Packages with leading underscores not indexed #383
Conversation
cdbdf04
to
1546b05
Compare
This is ready for merge now. |
@@ -705,6 +705,9 @@ sub set_indexed { | |||
my ( $self, $meta ) = @_; | |||
|
|||
foreach my $mod ( @{ $self->module } ) { | |||
if ( $mod->name =~ /^[_*]/ ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It isn't obvious why the asterisk is here... it makes me wonder if that was intentional.
Instead of special casing some exclusions (leading underscore), perhaps it would be better to use the same regexp that PAUSE does and simply invert the check:
if( $mod->name !~ /^[A-Za-z]/ ){ $mod->indexed(0) }
I would additionally then comment on why we're doing this check (where the regexp came from (link to the PAUSE source code)).
The test should still pass, but the code will be clearer and more representative of where the "rule" came from.
@rwstauner This makes more sense than what I tried. I made the change and I also added a little comment for clarification. I hope it is ok now. Many thanks for feedback. |
Yeah, I think that looks better. Thanks. If you comment out your new code in the lib, does your test fail? |
If I comment that, it will fail, but otherwise, how can I check the package name exactly? |
@andreeap Can you pull your master branch and then rebase this branch against that? After rebasing, replace Then you'll see that the test no longer passes. There's a very simple bug in the lib code, but the test isn't showing you that b/c the current test doesn't contain file content, and the doc won't index a module that doesn't have a |
@rwstauner Yes, I will rebase and make the changes and indeed I looked at the other tests for examples. |
The module still gets indexed, which means that I still don't check what am I supposed to? |
Ok, so now that the test is working properly, you can see that the code is not. In the lib code you compare the package to the regexp, and if it matches, set indexed 0, Inside your |
I can see it now and I feel stupid for this mistake, but at least next time I will pay extra attention. |
Happens to us all ;-) Thanks for doing this! |
Thank you for helping me :) |
A fix for #358, not ready to merge.