Skip to content

Commit 9bb3255

Browse files
committed
(GH-47) Expose additional indexes
Prior to this commit puppet-lint did not expose the following methods from `PuppetLint::Data`: * `array_indexes` * `hash_indexes` * `defaults_indexes` * `function_indexes` This commit adds public methods to `PuppetLint::CheckPlugin` so that the methods above are accessible from puppet-lint plugins.
1 parent 4763ac4 commit 9bb3255

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

lib/puppet-lint/checkplugin.rb

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,38 @@ def node_indexes
105105
PuppetLint::Data.node_indexes
106106
end
107107

108+
# Public: Provides positional information for any array definitions in the
109+
# tokens array to the check plugins.
110+
#
111+
# Returns an array of hashes containing the position information.
112+
def array_indexes
113+
PuppetLint::Data.array_indexes
114+
end
115+
116+
# Public: Provides positional information for any hash definitions in the
117+
# tokens array to the check plugins.
118+
#
119+
# Returns an array of hashes containing the position information.
120+
def hash_indexes
121+
PuppetLint::Data.hash_indexes
122+
end
123+
124+
# Public: Provides positional information for any default definitions in the
125+
# tokens array to the check plugins.
126+
#
127+
# Returns an Array of Hashes containing the position information.
128+
def defaults_indexes
129+
PuppetLint::Data.defaults_indexes
130+
end
131+
132+
# Public: Provides positional information for any function definition in the
133+
# tokens array to the check plugins.
134+
#
135+
# Returns an Array of Hashes containing the position information.
136+
def function_indexes
137+
PuppetLint::Data.function_indexes
138+
end
139+
108140
# Public: Provides the expanded path of the file being analysed to check
109141
# plugins.
110142
#

0 commit comments

Comments
 (0)