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

multiple different braces in same line cause false/positive? #4

Closed
bastelfreak opened this issue Jun 24, 2020 · 5 comments
Closed

multiple different braces in same line cause false/positive? #4

bastelfreak opened this issue Jun 24, 2020 · 5 comments

Comments

@bastelfreak
Copy link
Member

Given the following file:

define collectd::type (
  String                                                      $target,
  String                                                      $ds = $name,
  # BC compatible ....
  Optional[Enum['ABSOLUTE', 'COUNTER', 'DERIVE', 'GAUGE']]    $ds_type = undef,
  Variant[Numeric, Enum['U']]                                 $min = 'U',
  Variant[Numeric, Enum['U']]                                 $max = 'U',
  String                                                      $ds_name = 'value',
  # BC compatible .... ending

  Array[Struct[{
    min     => Variant[Numeric, Enum['U']],
    max     => Variant[Numeric, Enum['U']],
    ds_type => Enum['ABSOLUTE', 'COUNTER', 'DERIVE', 'GAUGE'],
    ds_name => String,
  }]]                                                         $types = [],
) {
  if empty($types) {
    $_types = [{
      min     => $min,
      max     => $max,
      ds_type => $ds_type,
      ds_name => $ds_name,
    }]
  } else {
    $_types = $types
  }

  $content = $_types.map |$type| { "${type['ds_name']}:${type['ds_type']}:${type['min']}:${type['max']}" }.join(', ')

  concat::fragment { "${target}/${ds}":
    content => "${ds}\t${content}",
    target  => $target,
    order   => $ds,
  }
}

the plugin in the latest version creates the following error:

manifests/type.pp:29:manifest_whitespace_closing_brace_after:ERROR:there should be either a bracket, comma, colon, closing quote or a newline after a closing brace, or whitespace and none of the aforementioned

but that might be a false positive? I'm not sure if there actually is an error. Can you please check this?

@jovandeginste
Copy link
Contributor

I think it's the .. This is a lot more complex than I thought at first 😉

@jovandeginste
Copy link
Contributor

@bastelfreak latest release should fix this...

@bastelfreak
Copy link
Member Author

Sadly not this time, the error stays with puppet-lint-manifest_whitespace-check 0.1.9.

@jovandeginste
Copy link
Contributor

Can you verify again (with v0.1.16)?

Thanks!

@bastelfreak
Copy link
Member Author

thanks, can confirm it's fixed now :)

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

2 participants