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

Select parameter tokens based on preceeding code token #934

Merged
merged 2 commits into from
Nov 10, 2020
Merged

Conversation

rodjek
Copy link
Owner

@rodjek rodjek commented Nov 10, 2020

Class/defined type parameter name tokens can be more accurately selected
based on the type of non-whitespace token that preceeds it.

:VARIABLE preceeded by:

  • :LPAREN - First parameter, no data type
  • :COMMA - Subsequent parameters, no data type
  • :TYPE - Parameter with a simple data type (e.g. String)
  • :RBRACK - Parameter with a complex data type (e.g. Array[String])

As before, tokens within balanced pairs of parens will be automatically
skipped over, preventing a function call that takes a variable parameter
from generating a false positive in the first 2 cases.

Fixes #930

Class/defined type parameter name tokens can be more accurately selected
based on the type of non-whitespace token that preceeds it.

`:VARIABLE` preceeded by:
  * `:LPAREN` - First parameter, no data type
  * `:COMMA` - Subsequent parameters, no data type
  * `:TYPE` - Parameter with a simple data type (e.g. `String`)
  * `:RBRACK - Parameter with a complex data type (e.g. `Array[String]`)

As before, tokens within balanced pairs of parens will be automatically
skipped over, preventing a function call that takes a variable parameter
from generating a false positive in the first 2 cases.

Fixes #930
@rodjek rodjek marked this pull request as ready for review November 10, 2020 03:55
@rodjek rodjek merged commit 8f42823 into master Nov 10, 2020
@rodjek rodjek deleted the issue-930 branch November 10, 2020 03:55
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

Successfully merging this pull request may close these issues.

Array operations on parameters confuse puppet-lint
1 participant