Skip to content

configuration of file include/exclude patterns for validation #341

@jeremy-asher

Description

@jeremy-asher

(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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions