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

configuration of file include/exclude patterns for validation #341

Closed
jeremy-asher opened this issue Nov 6, 2017 · 5 comments
Closed

configuration of file include/exclude patterns for validation #341

jeremy-asher opened this issue Nov 6, 2017 · 5 comments
Labels
feature JIRA JIRA Ticket Created

Comments

@jeremy-asher
Copy link

(see the rest of #329 for related discussion)

PDK currently uses relatively permissive patterns to build a list of files to scan for validation and supplies them as arguments to the various validators when they are invoked. This works in many cases, but is problematic when a module contains a file with an unexpected extension or when (for better or worse) external code is vendored into a module.

It is possible to configure a specific include pattern when performing pdk validate, but this include is shared among all the validators which throw errors when they cannot match their expected file types. See #329 (comment) for an example. This also appeared to trigger an early exit with return code 0 when I tried it.

Without PDK, Puppet testing is typically done with a Rakefile that contains individual configuration for some of the file patterns for puppet-lint and puppet-syntax gems while a .rubocop.yml file is often used to set exclusions for Ruby code. This is a bit complicated, but allows working around any issues of this nature. PDK simplifies the configuration by calling the validation tools directly, but removes the ability to configure the patterns.

PDK presents an interesting opportunity to centralize and simplify the include/exclude pattern logic, possibly with a PDK specific configuration file. Is this or any alternatives on the table for a future PDK release?

@DavidS
Copy link
Contributor

DavidS commented Nov 7, 2017

Part of this is tracked in https://tickets.puppetlabs.com/browse/PDK-663 , see also the linked comments there.

We definitely want to centralize this configuration. This was buried in the currently scheduled work around https://tickets.puppetlabs.com/browse/PDK-609 , but I've added a separate ticket (https://tickets.puppetlabs.com/browse/PDK-668) to make sure we don't miss it.

@jeremy-asher
Copy link
Author

Thanks @DavidS, that's good to hear. I can't access PDK-609, but if I've got this right, it looks like modulesync will be used to update configs. Is there a separate ticket to track exposing the includes or excludes to a PDK specific config file since this can't be done with any existing config?

@DavidS
Copy link
Contributor

DavidS commented Nov 7, 2017

I've unlocked PDK-609, that was an "accident". pdk new module is already using a moderately modulesync-compatible template renderer. We are extending it to also look at .sync.yml.

Between the .sync.yml, PDK-663, and CLI options there should be a good range of use-cases covered.

@jeremy-asher
Copy link
Author

Awesome, thanks @DavidS!

@sanfrancrisko
Copy link
Contributor

I've started a discussion here for any interested parties wanting to define how we go about implementing a global include/exclude list for all validators in the PDK: #1066

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

No branches or pull requests

5 participants