tokuhirom / Minilla

Authorizing tool for CPAN modules
https://metacpan.org/release/Minilla
Other
97 stars 65 forks source link

Question. File .perltidyrc #239

Open ivanych opened 6 years ago

ivanych commented 6 years ago

In my project, I use Perl::Tidy. The perltidy utility takes the settings from the .perltidyrc file.

I also have a test based on Test::Perltidy. The test also takes the settings from the .perltidy file.

Problem:

If you run the minil test, the .perltidyrc file is not copied to the temporary directory, in which tests are run. As a result, the test can not read the settings from the .perltidyrc file and is not executed correctly.

Question:

How to make the test read settings from .perltidy?

Thank you!

skaji commented 6 years ago

Thanks for creating this issue.

You can use FileGatherer.include_dotfiles in minil.toml:

[FileGatherer]
include_dotfiles = true
ivanych commented 6 years ago

Yes, this solves the problem, thanks!

But then another question arises:

In this case, all dot-files will be included in the distribution. Is this wrong? Is it a good idea to include dot-files in the distribution if they are only needed for the author's test?

skaji commented 6 years ago

You can also use exclude_match

[FileGatherer]
include_dotfiles= true
exclude_match = ['^\.(?!perltidy)']

BTW, I were you, I would set nothing for FileGatherer in minil.toml, and just execute prove -l t for test.

ivanych commented 6 years ago

just execute prove -l t for test.

I incorrectly asked a question.

This test will run when I launch the minil release. And this is good.

But without .perltidyrc it will start incorrectly. That's why I wanted to learn how to do it so that it would start correctly.

ivanych commented 6 years ago

Can I configure it so that the dotfiles are copied to a temporary directory for tests, but not copied to the distribution?

Grinnz commented 6 years ago

No, the build dir for tests is supposed to match what you end up releasing.