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

Question. File .perltidyrc #239

Open
ivanych opened this issue Apr 20, 2018 · 6 comments
Open

Question. File .perltidyrc #239

ivanych opened this issue Apr 20, 2018 · 6 comments

Comments

@ivanych
Copy link

ivanych commented Apr 20, 2018

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!

@ivanych ivanych changed the title Question. Question. File .perltidyrc Apr 20, 2018
@skaji
Copy link
Collaborator

skaji commented Apr 20, 2018

Thanks for creating this issue.

You can use FileGatherer.include_dotfiles in minil.toml:

[FileGatherer]
include_dotfiles = true

@ivanych
Copy link
Author

ivanych commented Apr 20, 2018

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
Copy link
Collaborator

skaji commented Apr 20, 2018

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
Copy link
Author

ivanych commented Apr 20, 2018

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
Copy link
Author

ivanych commented Apr 20, 2018

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

@Grinnz
Copy link
Contributor

Grinnz commented Apr 27, 2018

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

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

No branches or pull requests

3 participants