Skip to content

Commit bf4cb8c

Browse files
committed
do not report version variables as unused
1 parent b725538 commit bf4cb8c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Elastic.Markdown/DocumentationGenerator.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,13 @@ private void HintUnusedSubstitutionKeys()
180180
{
181181
var definedKeys = new HashSet<string>(Context.Configuration.Substitutions.Keys.ToArray());
182182
var inUse = new HashSet<string>(Context.Collector.InUseSubstitutionKeys.Keys);
183-
var keysNotInUse = definedKeys.Except(inUse).ToArray();
183+
var keysNotInUse = definedKeys.Except(inUse)
184+
// versions keys are injected
185+
.Where(key => !key.StartsWith("version."))
186+
// reserving context namespace
187+
.Where(key => !key.StartsWith("context."))
188+
.ToArray();
189+
184190
// If we have less than 20 unused keys, emit them separately,
185191
// Otherwise emit one hint with all of them for brevity
186192
if (keysNotInUse.Length >= 20)

0 commit comments

Comments
 (0)