Skip to content

Commit fd0946b

Browse files
authored
[DOCS] Remove support for // CONSOLE magic comment (#46936)
#46180 added support for the `[source,console]` language for snippets which should be tested. This removes support for the `// CONSOLE` magic comment, which serve a similar purpose. Snippets that include the `// CONSOLE` magic comment will return an exception.
1 parent 9df6cbe commit fd0946b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/RestTestsFromSnippetsTask.groovy

+5-2
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,11 @@ public class RestTestsFromSnippetsTask extends SnippetsTask {
206206
response(snippet)
207207
return
208208
}
209-
if (snippet.test || snippet.console ||
210-
snippet.language == 'console') {
209+
if ((snippet.language == 'js') && (snippet.console)) {
210+
throw new InvalidUserDataException(
211+
"$snippet: Use `[source,console]` instead of `// CONSOLE`.")
212+
}
213+
if (snippet.test || snippet.language == 'console') {
211214
test(snippet)
212215
previousTest = snippet
213216
return

0 commit comments

Comments
 (0)