Skip to content

Commit d8c8643

Browse files
calcmogulPeterJohnson
authored andcommitted
Format HTML and XML files (wpilibsuite#944)
Generated by wpilibsuite/styleguide#52.
1 parent adb6098 commit d8c8643

File tree

7 files changed

+633
-503
lines changed

7 files changed

+633
-503
lines changed

styleguide/checkstyle.xml

+268-210
Large diffs are not rendered by default.

styleguide/checkstyleExamples.xml

+273-213
Large diffs are not rendered by default.

styleguide/pmd-ruleset.xml

+48-49
Original file line numberDiff line numberDiff line change
@@ -3,59 +3,58 @@
33
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
44
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
55
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
6-
<rule ref="rulesets/java/basic.xml" />
7-
<rule ref="rulesets/java/braces.xml" />
8-
<rule ref="rulesets/java/empty.xml" />
9-
<rule ref="rulesets/java/empty.xml/EmptyCatchBlock">
10-
<properties>
11-
<property name="allowCommentedBlocks" value="true"/>
12-
</properties>
13-
</rule>
14-
<rule ref="rulesets/java/imports.xml" />
15-
<rule ref="rulesets/java/junit.xml">
16-
<exclude name="JUnitTestContainsTooManyAsserts" />
17-
</rule>
18-
<rule ref="rulesets/java/strings.xml">
19-
<exclude name="AvoidDuplicateLiterals" />
20-
</rule>
21-
<rule ref="rulesets/java/unnecessary.xml" />
22-
<rule ref="rulesets/java/unusedcode.xml" />
23-
<rule ref="rulesets/java/unusedcode.xml/UnusedFormalParameter">
24-
<properties>
25-
<property name="checkAll" value="true"/>
26-
</properties>
27-
</rule>
286

29-
<!-- Custom Rules -->
30-
31-
<rule name="UseRequireNonNull"
32-
message="Use Objects.requireNonNull() instead of throwing a NullPointerException yourself."
33-
language="java"
34-
class="net.sourceforge.pmd.lang.rule.XPathRule">
35-
<description>
36-
Use Objects.requireNonNull() instead of throwing a NullPointerException yourself.
37-
</description>
38-
<properties>
39-
<property name="xpath">
40-
<value>
41-
<![CDATA[
7+
<rule ref="rulesets/java/basic.xml" />
8+
<rule ref="rulesets/java/braces.xml" />
9+
<rule ref="rulesets/java/empty.xml" />
10+
<rule ref="rulesets/java/empty.xml/EmptyCatchBlock">
11+
<properties>
12+
<property name="allowCommentedBlocks"
13+
value="true" />
14+
</properties>
15+
</rule>
16+
<rule ref="rulesets/java/imports.xml" />
17+
<rule ref="rulesets/java/junit.xml">
18+
<exclude name="JUnitTestContainsTooManyAsserts" />
19+
</rule>
20+
<rule ref="rulesets/java/strings.xml">
21+
<exclude name="AvoidDuplicateLiterals" />
22+
</rule>
23+
<rule ref="rulesets/java/unnecessary.xml" />
24+
<rule ref="rulesets/java/unusedcode.xml" />
25+
<rule ref="rulesets/java/unusedcode.xml/UnusedFormalParameter">
26+
<properties>
27+
<property name="checkAll"
28+
value="true" />
29+
</properties>
30+
</rule>
31+
<!-- Custom Rules -->
32+
<rule name="UseRequireNonNull"
33+
message="Use Objects.requireNonNull() instead of throwing a NullPointerException yourself."
34+
language="java"
35+
class="net.sourceforge.pmd.lang.rule.XPathRule">
36+
<description>Use Objects.requireNonNull() instead of throwing a
37+
NullPointerException yourself.</description>
38+
<properties>
39+
<property name="xpath">
40+
<value>
41+
<![CDATA[
4242
//IfStatement[child::Expression//NullLiteral]/Statement//ThrowStatement/Expression/PrimaryExpression/PrimaryPrefix/AllocationExpression/ClassOrInterfaceType[@Image='NullPointerException']
4343
]]>
44-
</value>
45-
</property>
46-
</properties>
47-
<priority>3</priority>
48-
<example>
49-
<![CDATA[
44+
</value>
45+
</property>
46+
</properties>
47+
<priority>3</priority>
48+
<example>
49+
<![CDATA[
5050
public class Example {
51-
public Example(Object example) {
52-
if (example == null) {
53-
throw new NullPointerException();
54-
}
55-
}
51+
public Example(Object example) {
52+
if (example == null) {
53+
throw new NullPointerException();
54+
}
55+
}
5656
}
5757
]]>
58-
</example>
59-
</rule>
60-
58+
</example>
59+
</rule>
6160
</ruleset>

styleguide/suppressions.xml

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?xml version="1.0"?>
2-
3-
<!DOCTYPE suppressions PUBLIC
4-
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
5-
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
2+
<!DOCTYPE
3+
suppressions PUBLIC "-//Puppy Crawl//DTD Suppressions 1.1//EN"
4+
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
65
<suppressions>
7-
<suppress files=".*sim.*" checks="[a-zA-Z0-9]*"/>
8-
<suppress files="edu.wpi.first.wpilibj.util.WPILibVersion" checks="[a-zA-Z0-9]*"/>
6+
<suppress files=".*sim.*"
7+
checks="[a-zA-Z0-9]*" />
8+
<suppress files="edu.wpi.first.wpilibj.util.WPILibVersion"
9+
checks="[a-zA-Z0-9]*" />
910
</suppressions>

tidy-html.conf

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
indent: yes
2+
indent-spaces: 2
3+
wrap: 80

tidy-xml.conf

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
indent: yes
2+
indent-spaces: 2
3+
indent-attributes: yes
4+
literal-attributes: yes
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
1-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2-
<html>
3-
<head>
4-
<title>WPI Robotics library</title>
5-
<meta http-equiv="Content-Type" content="text/html; charset=MacRoman">
6-
</head>
7-
<body>
8-
The WPI Robotics library (WPILibJ) is a set of Java classes that interfaces to the hardware in the
9-
FRC control system and your robot. There are classes to handle sensors, motors, the driver
10-
station, and a number of other utility functions like timing and field management.
11-
The library is designed to:
12-
<ul>
13-
<li>Deal with all the low level interfacing to these components so you can concentrate on
14-
solving this year's "robot problem". This is a philosophical decision to let you focus
15-
on the higher-level design of your robot rather than deal with the details of the
16-
processor and the operating system.
17-
</li>
18-
<li>Understand everything at all levels by making the full source code of the library
19-
available. You can study (and modify) the algorithms used by the gyro class for
20-
oversampling and integration of the input signal or just ask the class for the current
21-
robot heading. You can work at any level.
22-
</li>
23-
</ul>
24-
</body>
25-
</html>
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2+
<html>
3+
<head>
4+
<title>
5+
WPI Robotics library
6+
</title>
7+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
8+
</head>
9+
<body>
10+
The WPI Robotics library (WPILibJ) is a set of Java classes that interfaces
11+
to the hardware in the FRC control system and your robot. There are classes
12+
to handle sensors, motors, the driver station, and a number of other
13+
utility functions like timing and field management. The library is designed
14+
to:
15+
<ul>
16+
<li>Deal with all the low level interfacing to these components so you
17+
can concentrate on solving this year's "robot problem". This is a
18+
philosophical decision to let you focus on the higher-level design of
19+
your robot rather than deal with the details of the processor and the
20+
operating system.
21+
</li>
22+
<li>Understand everything at all levels by making the full source code of
23+
the library available. You can study (and modify) the algorithms used by
24+
the gyro class for oversampling and integration of the input signal or
25+
just ask the class for the current robot heading. You can work at any
26+
level.
27+
</li>
28+
</ul>
29+
</body>
30+
</html>

0 commit comments

Comments
 (0)