Skip to content
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

Account for modules in the no_index section of META.yml #4

Merged
merged 3 commits into from
Apr 29, 2013

Conversation

guillaumeaubert
Copy link
Contributor

Thank you for writing this module, it is a nice extension of Test::Kwalitee. I've already successfully used it on Perl::Critic::Git, but I'm having problems retrofitting DBIx::NinjaORM.

DBIx::NinjaORM uses an internal module (t/lib/LocalTest.pm) that I have specified as no_index in META.yml. As a result, it is not visible on MetaCPAN, and the following call in Extra.pm fails:

my $result = $mcpan->module($key);

This is however a valid module used internally by the distribution, and should not be treated as an external use.

With the attached commit, I'm proposing to identify packages in files listed in the no_index section of META.yml, and skipping those when examining external uses. I've tested the change successfully on DBIx::NinjaORM, and I tried to keep your coding style in this patch. Please let me know what you think!

@yak1ex
Copy link
Owner

yak1ex commented Mar 24, 2013

Thank you for your feedback! I'll check it.

@yak1ex
Copy link
Owner

yak1ex commented Mar 26, 2013

Hi. If you want it, I will merge this request soon.
However, if you could provide the following points, I would be very glad.

  • no_index can have not only file but also directory, package, and/or namespace. Is it better to support them?
    Even if it will be not supported, it is user-friendly to describe the limitation, at least.
  • Code to extract module names are inspired by Module::CPANTS::Kwalitee::FindModules as described. The code extracts the first package in a file. I guess it is not harmful to extract all packages but a bit robust. For the purpose, Module::Extract::Namespaces might be usable though it might be overkill.

Again, if you want it, I will merge this request soon.

@guillaumeaubert
Copy link
Contributor Author

Hi Yasutaka,

I think your two points are great ideas, I'm going to make the changes and edit my pull request to include them. I will try to have both ready for you this weekend.

Thank you!

@yak1ex
Copy link
Owner

yak1ex commented Apr 15, 2013

How about the status?

@guillaumeaubert
Copy link
Contributor Author

Hi Yasutaka,

My apologies, I haven't had as much free time as I expected in the last couple of weeks. I have implemented file, package, and namespace, but I need to finish directory before I can submit the updated patch. I'll give you an update as soon as I can!

@yak1ex
Copy link
Owner

yak1ex commented Apr 16, 2013

Hi Guillaume. No problem.

I have implemented file, package, and namespace

Great. I'm looking forward to your update. Thanks.

@guillaumeaubert
Copy link
Contributor Author

Hi Yasutaka,

Thank you for your patience. I just pushed two commits that generalize the code to handle all four possible sections of no_index. I also included a test file to cover the new subroutine, so that all my additions are tested.

Please let me know if you have any questions or suggestions for further improvement!

yak1ex added a commit that referenced this pull request Apr 29, 2013
Account for modules in the no_index section of META.yml
@yak1ex yak1ex merged commit 5cebd8a into yak1ex:master Apr 29, 2013
@yak1ex
Copy link
Owner

yak1ex commented Apr 29, 2013

Thank you for your great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants