Skip to content

Commit

Permalink
Issue checkstyle#7301: fix check for wrapper, add handling of small i…
Browse files Browse the repository at this point in the history
…mages, fix source
  • Loading branch information
jo2 committed Dec 5, 2019
1 parent 4b6ad27 commit 0da85cf
Show file tree
Hide file tree
Showing 10 changed files with 588 additions and 310 deletions.
15 changes: 12 additions & 3 deletions src/site/resources/css/site.css
Expand Up @@ -52,9 +52,14 @@ h2:hover .anchor, h3:hover .anchor {
}

.source {
width: 90%;
overflow-x: auto;
white-space: nowrap;
padding: 0;
}

.source > pre {
margin: 0;
padding: 12px;
overflow-x: auto;
}

.wrap-content pre {
Expand All @@ -76,10 +81,14 @@ section {
overflow-y: auto;
}

span.wrapper {
span.wrapper.block {
display: block;
}

span.wrapper.inline {
display: inline;
}

@media screen and (max-width: 600px) {
#leftColumn {
float: none;
Expand Down
Expand Up @@ -51,7 +51,7 @@ public void setUp() {

@Test
public void testAllCheckSectionMobileWrapper() throws Exception {
for (Path path : XdocUtil.getXdocsConfigFilePaths(XdocUtil.getXdocsFilePaths())) {
for (Path path : XdocUtil.getXdocsFilePaths()) {
final File file = path.toFile();
final String fileName = file.getName();

Expand Down Expand Up @@ -88,9 +88,18 @@ private static void iterateNode(Node node, String fileName, String sectionName)
Assert.assertTrue(wrapperMessage,
node.getAttributes().getNamedItem("class").getNodeValue()
.contains("wrapper"));

if ("table".equals(child.getNodeName())) {
iterateNode(child, fileName, sectionName);
}
if ("img".equals(child.getNodeName())) {
final String dataImageInlineMessage = fileName + "/" + sectionName + ": img "
+ "needs the additional class inline if it should be displayed inline "
+ "or block if scrolling in mobile view should be enabled.";
Assert.assertTrue(dataImageInlineMessage,
node.getAttributes().getNamedItem("class").getNodeValue()
.matches(".*(block|inline).*"));
}
}
else {
iterateNode(child, fileName, sectionName);
Expand Down
26 changes: 13 additions & 13 deletions src/xdocs/eclipse.xml
Expand Up @@ -32,7 +32,7 @@
<section name="Import Checkstyle Project">
<p>
Select File > Import > Maven > Existing Maven Projects<br/><br/>
<span class="wrapper">
<span class="wrapper block">
<img alt="screenshot" src="images/gui_screenshot_importing_eclipse.png"/>
</span>
</p>
Expand All @@ -42,7 +42,7 @@
<p>When you import Checkstyle Project, "Setup maven plugin connectors" window will appear.</p>
<p>
Left click on "Finish".<br/><br/>
<span class="wrapper">
<span class="wrapper block">
<img alt="screenshot"
src="images/gui_screenshot_setup_maven_plugin_connectors_eclipse.png"/>
</span>
Expand All @@ -53,17 +53,17 @@
<br/><br/>
Left click on Next > Next.
<br/><br/>
<span class="wrapper">
<span class="wrapper block">
<img alt="screenshot" src="images/gui_screenshot_install_connector_eclipse.png"/>
</span>
<br/><br/>
<span class="wrapper">
<span class="wrapper block">
<img alt="screenshot" src="images/gui_screenshot_install_connector_details_eclipse.png"/>
</span>
<br/><br/>
Set "I accept the terms of the license agreement" > Finish.
<br/><br/>
<span class="wrapper">
<span class="wrapper block">
<img alt="screenshot" src="images/gui_screenshot_install_connector_license_eclipse.png"/>
</span>
</p>
Expand All @@ -72,15 +72,15 @@
Then "Security Warning" window will appear.
<br/><br/>
Left click on "OK", and then restart Eclipse.<br/><br/>
<span class="wrapper">
<span class="wrapper block">
<img alt="screenshot"
src="images/gui_screenshot_install_connector_security_warning_eclipse.png"/>
</span>
</p>
<p>
<br/><br/>
Then target/generated-sources/antlr folder will appear in Package Explorer.<br/><br/>
<span class="wrapper">
<span class="wrapper block">
<img alt="screenshot" src="images/gui_screenshot_package_explorer_eclipse.png"/>
</span>
</p>
Expand All @@ -102,7 +102,7 @@
<p>
2) Ignore optional compile problems on resource files:<br/><br/>
Right click on Checkstyle project > Build Path > Configure Build Path...<br/><br/>
<span class="wrapper">
<span class="wrapper block">
<img alt="screenshot" src="images/gui_screenshot_eclipse_build_path.png"/>
</span>
</p>
Expand All @@ -116,7 +116,7 @@
<li>target/generated-sources/antlr</li>
</ul>
<p>
<span class="wrapper">
<span class="wrapper block">
<img alt="screenshot" src="images/gui_screenshot_eclipse_ignore_warnings.png"/>
</span>
</p>
Expand All @@ -133,7 +133,7 @@
picture).<br/>
Default configuration should look as following (you can also try Restore Defaults
button):<br/><br/>
<span class="wrapper">
<span class="wrapper block">
<img alt="Organize Imports settings in Eclipse"
src="images/gui_screenshot_organize_imports_eclipse.png"/>
</span>
Expand All @@ -144,19 +144,19 @@
<section name="Debug">
<p>
Open the Check's source file by double click on it in a source tree as is shown:<br/><br/>
<span class="wrapper">
<span class="wrapper block">
<img alt="screenshot" src="images/gui_screenshot_select_check_eclipse.png"/>
</span>
<br/><br/>
Debug the Check by putting the breakpoint at controversial place (double-click)
on the left part of line number as it is shown:<br/><br/>
<span class="wrapper">
<span class="wrapper block">
<img alt="screenshot" src="images/gui_screenshot_debug_eclipse.png"/>
</span>
<br/><br/>
Then right-click the corresponding Unit-test file or class definition > Debug As >
JUnit Test<br/><br/>
<span class="wrapper">
<span class="wrapper block">
<img alt="screenshot" src="images/gui_screenshot_ut_select_eclipse.png"/>
</span>
<br/><br/>
Expand Down

0 comments on commit 0da85cf

Please sign in to comment.