rspec/rules/S1930/html/rule.adoc
Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00

43 lines
957 B
Plaintext

== Why is this an issue?
While you can use as many ``++page++`` directives as you like, it is more readable to set multiple page attributes in a single directive.
The exception to this rule is when multiple packages are being imported. In that case, imports may be done in separate directives and all other attributes should be set in a single, additional directive.
=== Noncompliant code example
[source,html]
----
<%@ page session="false" %>
<%@ page import="java.util.*" %>
<%@ page errorPage="error.jsp" %> <!-- Noncompliant -->
<%@ page import="java.text.*" %>
----
=== Compliant solution
[source,html]
----
<%@ page session="false"
errorPage="error.jsp" %>
<%@ page import="java.util.*" %>
<%@ page import="java.text.*" %>
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Combine these X page directives into one.
endif::env-github,rspecator-view[]