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

Support Types in Selectors #4

Closed
jkroepke opened this issue Dec 5, 2017 · 4 comments · Fixed by #9
Closed

Support Types in Selectors #4

jkroepke opened this issue Dec 5, 2017 · 4 comments · Fixed by #9

Comments

@jkroepke
Copy link

jkroepke commented Dec 5, 2017

Related: #1

Datatypes shoudn't be quoted.

Refer documentation for allowed selectors:
https://puppet.com/docs/puppet/5.3/lang_conditional.html#behavior-3

Example:

    $_rightid = $client ? {
      Stdlib::Compat::Ipv4 => $client,
      default              => "@${client}",
    }

Current:

site/profile/manifests/ipsec.pp:160:unquoted_string_in_selector:WARNING:unquoted string in selector
  Stdlib::Compat::Ipv4 => $client,

Expected:

No Issue

Versions:

Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Fetching rake 12.3.0
Installing rake 12.3.0
Using bundler 1.16.0
Fetching facter 2.5.1
Installing facter 2.5.1
Fetching fast_gettext 1.1.0
Installing fast_gettext 1.1.0
Fetching locale 2.1.2
Installing locale 2.1.2
Fetching text 1.3.1
Installing text 1.3.1
Fetching gettext 3.2.4
Installing gettext 3.2.4
Fetching gettext-setup 0.29
Installing gettext-setup 0.29
Fetching hiera 3.4.2
Installing hiera 3.4.2
Fetching puppet 5.3.3
Installing puppet 5.3.3
Fetching puppet-lint 2.3.3
Installing puppet-lint 2.3.3
Fetching puppet-lint-classes_and_types_beginning_with_digits-check 0.1.2
Installing puppet-lint-classes_and_types_beginning_with_digits-check 0.1.2
Fetching puppet-lint-leading_zero-check 0.1.1
Installing puppet-lint-leading_zero-check 0.1.1
Fetching puppet-lint-legacy_facts-check 0.0.3
Installing puppet-lint-legacy_facts-check 0.0.3
Fetching puppet-lint-top_scope_facts-check 0.0.1
Installing puppet-lint-top_scope_facts-check 0.0.1
Fetching puppet-lint-trailing_comma-check 0.3.2
Installing puppet-lint-trailing_comma-check 0.3.2
Fetching puppet-lint-unquoted_string-check 0.3.0
Installing puppet-lint-unquoted_string-check 0.3.0
Fetching puppet-lint-variable_contains_upcase 1.2.0
Installing puppet-lint-variable_contains_upcase 1.2.0
Fetching puppet-lint-version_comparison-check 0.2.1
Installing puppet-lint-version_comparison-check 0.2.1
Fetching puppet-syntax 2.4.1
Installing puppet-syntax 2.4.1
Bundle complete! 12 Gemfile dependencies, 20 gems now installed.
Gems in the groups system_tests, development and release were not installed.
Bundled gems are installed into `/usr/local/bundle`
@ghoneycutt
Copy link
Member

ghoneycutt commented Sep 16, 2019

Perhaps this is solved by #5 ?

A test added would verify this and possibly close it.

@vStone
Copy link

vStone commented Feb 28, 2020

I'm looking at the docs and types should also be allowed in case statements

@ekohl
Copy link
Member

ekohl commented Mar 24, 2020

I can confirm this is still an issue. It's valid code, but the lint check doesn't properly detect this. #9 adds a reproducer which shows that it happens with namespaced types. So Undef works but Stdlib::IP::Address::V6 doesn't.

@ekohl
Copy link
Member

ekohl commented Mar 24, 2020

So rodjek/puppet-lint#485 is the root cause for this. tl;dr is that the syntax for a :TYPE is the same as a :CLASSREF.

@ekohl ekohl linked a pull request Mar 24, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants