-
Notifications
You must be signed in to change notification settings - Fork 632
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 underscores in class and definitions names in puppetParser #1904
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
9171923
PuppetManifest: allow to use a underscore char and a hyphen char in a…
masatake d99a273
Minor fix on the puppetManifest parser regular expressions.
ahakanbaba b6b46df
Instantiate the defined resources correctly
f2703d5
Fix failing tests by adding the diff of the tags file
ahakanbaba File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--sort=no | ||
--fields=+KZlne |
10 changes: 10 additions & 0 deletions
10
Units/parser-puppetManifest.r/puppet-classname.d/expected.tags
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
t input.pp /^class t {$/;" class line:1 language:PuppetManifest end:3 | ||
/tmp/multipleclasst input.pp /^ file { "\/tmp\/multipleclasst": content => "one" }$/;" resource line:2 language:PuppetManifest scope:class:t end:2 | ||
one_ input.pp /^class one_ {$/;" class line:5 language:PuppetManifest end:7 | ||
/tmp/multipleclassone_ input.pp /^ file { "\/tmp\/multipleclassone_": content => "one" }$/;" resource line:6 language:PuppetManifest scope:class:one_ end:6 | ||
on_e input.pp /^class on_e {$/;" class line:9 language:PuppetManifest end:11 | ||
/tmp/multipleclasson_e input.pp /^ file { "\/tmp\/multipleclasson_e": content => "one" }$/;" resource line:10 language:PuppetManifest scope:class:on_e end:10 | ||
o_ne::tw_o input.pp /^class o_ne::tw_o {$/;" class line:14 language:PuppetManifest end:16 | ||
/tmp/multipleclasso_netw_o input.pp /^ file { "\/tmp\/multipleclasso_netw_o": content => "two" }$/;" resource line:15 language:PuppetManifest scope:class:o_ne::tw_o end:15 | ||
o_ne::two_ input.pp /^class o_ne::two_ {$/;" class line:18 language:PuppetManifest end:20 | ||
/tmp/multipleclasso_netwo_ input.pp /^ file { "\/tmp\/multipleclasso_netwo_": content => "two" }$/;" resource line:19 language:PuppetManifest scope:class:o_ne::two_ end:19 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
class t { | ||
file { "/tmp/multipleclasst": content => "one" } | ||
} | ||
|
||
class one_ { | ||
file { "/tmp/multipleclassone_": content => "one" } | ||
} | ||
|
||
class on_e { | ||
file { "/tmp/multipleclasson_e": content => "one" } | ||
} | ||
|
||
|
||
class o_ne::tw_o { | ||
file { "/tmp/multipleclasso_netw_o": content => "two" } | ||
} | ||
|
||
class o_ne::two_ { | ||
file { "/tmp/multipleclasso_netwo_": content => "two" } | ||
} | ||
|
||
include t | ||
include one_ | ||
include on_e | ||
include o_ne::tw_o | ||
include o_ne::two_ |
2 changes: 2 additions & 0 deletions
2
Units/parser-puppetManifest.r/puppet-definitionname.d/args.ctags
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--sort=no | ||
--fields=+KZlne |
11 changes: 11 additions & 0 deletions
11
Units/parser-puppetManifest.r/puppet-definitionname.d/expected.tags
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
t input.pp /^define t {$/;" definition line:2 language:PuppetManifest end:4 | ||
/tmp/multipledefinet input.pp /^ file { "\/tmp\/multipledefinet": content => "one" }$/;" resource line:3 language:PuppetManifest scope:definition:t end:3 | ||
one_ input.pp /^define one_ {$/;" definition line:6 language:PuppetManifest end:8 | ||
/tmp/multipledefineone_ input.pp /^ file { "\/tmp\/multipledefineone_": content => "one" }$/;" resource line:7 language:PuppetManifest scope:definition:one_ end:7 | ||
on_e input.pp /^define on_e {$/;" definition line:10 language:PuppetManifest end:12 | ||
/tmp/multipledefineon_e input.pp /^ file { "\/tmp\/multipledefineon_e": content => "one" }$/;" resource line:11 language:PuppetManifest scope:definition:on_e end:11 | ||
o_ne::tw_o input.pp /^define o_ne::tw_o {$/;" definition line:15 language:PuppetManifest end:17 | ||
/tmp/multipledefineo_netw_o input.pp /^ file { "\/tmp\/multipledefineo_netw_o": content => "two" }$/;" resource line:16 language:PuppetManifest scope:definition:o_ne::tw_o end:16 | ||
o_ne::two_ input.pp /^define o_ne::two_ {$/;" definition line:19 language:PuppetManifest end:21 | ||
/tmp/multipledefineo_netwo_ input.pp /^ file { "\/tmp\/multipledefineo_netwo_": content => "two" }$/;" resource line:20 language:PuppetManifest scope:definition:o_ne::two_ end:20 | ||
t input.pp /^t { 't': }$/;" resource line:23 language:PuppetManifest end:23 | ||
27 changes: 27 additions & 0 deletions
27
Units/parser-puppetManifest.r/puppet-definitionname.d/input.pp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
define t { | ||
file { "/tmp/multipledefinet": content => "one" } | ||
} | ||
|
||
define one_ { | ||
file { "/tmp/multipledefineone_": content => "one" } | ||
} | ||
|
||
define on_e { | ||
file { "/tmp/multipledefineon_e": content => "one" } | ||
} | ||
|
||
|
||
define o_ne::tw_o { | ||
file { "/tmp/multipledefineo_netw_o": content => "two" } | ||
} | ||
|
||
define o_ne::two_ { | ||
file { "/tmp/multipledefineo_netwo_": content => "two" } | ||
} | ||
|
||
t { 't': } | ||
one_ { 'one_': } | ||
on_e { 'on_e': } | ||
o_ne::tw_o { 'o_ne::tw_o': } | ||
o_ne::two_ { 'o_ne::two_': } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably another bug's indication.
In the source file 5 different resources have been declared.
But this tag file only mentions one of them.
I suspect there is another regular expression somewhere missing the "_" char.
@masatake if you point me to the right direction I can also fix that in another PR.