Skip to content

Commit 24e3aa5

Browse files
authored
added linting
1 parent 183249d commit 24e3aa5

File tree

2 files changed

+202
-2
lines changed

2 files changed

+202
-2
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
# Intro-04-Java-HelloWorldStyle
2-
[![Mr Coxall's Super Linter](https://github.com/ICS4U-Programming-AngelI/Intro-04-Java-HelloWorldStyle/workflows/Mr%20Coxall's%20Super%20Linter/badge.svg)](https://github.com/ICS4U-Programming-AngelI/Intro-04-Java-HelloWorldStyle/actions/)
1+
# **NOTE: This directory holds the file to Lint your code.**

sun_checks.xml

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE module PUBLIC
3+
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
4+
"https://checkstyle.org/dtds/configuration_1_3.dtd">
5+
6+
<!--
7+
8+
Checkstyle configuration that checks the sun coding conventions from:
9+
10+
- the Java Language Specification at
11+
https://docs.oracle.com/javase/specs/jls/se11/html/index.html
12+
13+
- the Sun Code Conventions at https://www.oracle.com/java/technologies/javase/codeconventions-contents.html
14+
15+
- the Javadoc guidelines at
16+
https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html
17+
18+
- the JDK Api documentation https://docs.oracle.com/en/java/javase/11/
19+
20+
- some best practices
21+
22+
Checkstyle is very configurable. Be sure to read the documentation at
23+
https://checkstyle.org (or in your downloaded distribution).
24+
25+
Most Checks are configurable, be sure to consult the documentation.
26+
27+
To completely disable a check, just comment it out or delete it from the file.
28+
To suppress certain violations please review suppression filters.
29+
30+
Finally, it is worth reading the documentation.
31+
32+
-->
33+
34+
<module name="Checker">
35+
<!--
36+
If you set the basedir property below, then all reported file
37+
names will be relative to the specified directory. See
38+
https://checkstyle.org/config.html#Checker
39+
40+
<property name="basedir" value="${basedir}"/>
41+
-->
42+
<property name="severity" value="error"/>
43+
44+
<property name="fileExtensions" value="java, properties, xml"/>
45+
46+
<!-- Excludes all 'module-info.java' files -->
47+
<!-- See https://checkstyle.org/filefilters/index.html -->
48+
<module name="BeforeExecutionExclusionFileFilter">
49+
<property name="fileNamePattern" value="module\-info\.java$"/>
50+
</module>
51+
52+
<!-- https://checkstyle.org/filters/suppressionfilter.html -->
53+
<module name="SuppressionFilter">
54+
<property name="file" value="${org.checkstyle.sun.suppressionfilter.config}"
55+
default="checkstyle-suppressions.xml" />
56+
<property name="optional" value="true"/>
57+
</module>
58+
59+
<!-- Checks that a package-info.java file exists for each package. -->
60+
<!-- See https://checkstyle.org/checks/javadoc/javadocpackage.html#JavadocPackage -->
61+
<!-- REMOVING
62+
<module name="JavadocPackage"/>
63+
-->
64+
<!-- Checks whether files end with a new line. -->
65+
<!-- See https://checkstyle.org/checks/misc/newlineatendoffile.html -->
66+
<module name="NewlineAtEndOfFile"/>
67+
68+
<!-- Checks that property files contain the same keys. -->
69+
<!-- See https://checkstyle.org/checks/misc/translation.html -->
70+
<module name="Translation"/>
71+
72+
<!-- Checks for Size Violations. -->
73+
<!-- See https://checkstyle.org/checks/sizes/index.html -->
74+
<module name="FileLength"/>
75+
<module name="LineLength">
76+
<property name="fileExtensions" value="java"/>
77+
</module>
78+
79+
<!-- Checks for whitespace -->
80+
<!-- See https://checkstyle.org/checks/whitespace/index.html -->
81+
<module name="FileTabCharacter"/>
82+
83+
<!-- Miscellaneous other checks. -->
84+
<!-- See https://checkstyle.org/checks/misc/index.html -->
85+
<module name="RegexpSingleline">
86+
<property name="format" value="\s+$"/>
87+
<property name="minimum" value="0"/>
88+
<property name="maximum" value="0"/>
89+
<property name="message" value="Line has trailing spaces."/>
90+
</module>
91+
92+
<!-- Checks for Headers -->
93+
<!-- See https://checkstyle.org/checks/header/index.html -->
94+
<!-- <module name="Header"> -->
95+
<!-- <property name="headerFile" value="${checkstyle.header.file}"/> -->
96+
<!-- <property name="fileExtensions" value="java"/> -->
97+
<!-- </module> -->
98+
99+
<module name="TreeWalker">
100+
101+
<!-- Checks for Javadoc comments. -->
102+
<!-- See https://checkstyle.org/checks/javadoc/index.html -->
103+
<module name="InvalidJavadocPosition"/>
104+
<module name="JavadocMethod"/>
105+
<module name="JavadocType"/>
106+
<module name="JavadocVariable"/>
107+
<module name="JavadocStyle"/>
108+
<module name="MissingJavadocMethod"/>
109+
110+
<!-- Checks for Naming Conventions. -->
111+
<!-- See https://checkstyle.org/checks/naming/index.html -->
112+
<module name="ConstantName"/>
113+
<module name="LocalFinalVariableName"/>
114+
<module name="LocalVariableName"/>
115+
<module name="MemberName"/>
116+
<module name="MethodName"/>
117+
<module name="PackageName"/>
118+
<module name="ParameterName"/>
119+
<module name="StaticVariableName"/>
120+
<module name="TypeName"/>
121+
122+
<!-- Checks for imports -->
123+
<!-- See https://checkstyle.org/checks/imports/index.html -->
124+
<module name="AvoidStarImport"/>
125+
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
126+
<module name="RedundantImport"/>
127+
<module name="UnusedImports">
128+
<property name="processJavadoc" value="false"/>
129+
</module>
130+
131+
<!-- Checks for Size Violations. -->
132+
<!-- See https://checkstyle.org/checks/sizes/index.html -->
133+
<module name="MethodLength"/>
134+
<module name="ParameterNumber"/>
135+
136+
<!-- Checks for whitespace -->
137+
<!-- See https://checkstyle.org/checks/whitespace/index.html -->
138+
<module name="EmptyForIteratorPad"/>
139+
<module name="GenericWhitespace"/>
140+
<module name="MethodParamPad"/>
141+
<module name="NoWhitespaceAfter"/>
142+
<module name="NoWhitespaceBefore"/>
143+
<module name="OperatorWrap"/>
144+
<module name="ParenPad"/>
145+
<module name="TypecastParenPad"/>
146+
<module name="WhitespaceAfter"/>
147+
<module name="WhitespaceAround"/>
148+
149+
<!-- Modifier Checks -->
150+
<!-- See https://checkstyle.org/checks/modifier/index.html -->
151+
<module name="ModifierOrder"/>
152+
<module name="RedundantModifier"/>
153+
154+
<!-- Checks for blocks. You know, those {}'s -->
155+
<!-- See https://checkstyle.org/checks/blocks/index.html -->
156+
<module name="AvoidNestedBlocks"/>
157+
<module name="EmptyBlock"/>
158+
<module name="LeftCurly"/>
159+
<module name="NeedBraces"/>
160+
<module name="RightCurly"/>
161+
162+
<!-- Checks for common coding problems -->
163+
<!-- See https://checkstyle.org/checks/coding/index.html -->
164+
<module name="EmptyStatement"/>
165+
<module name="EqualsHashCode"/>
166+
<module name="HiddenField"/>
167+
<module name="IllegalInstantiation"/>
168+
<module name="InnerAssignment"/>
169+
<!-- REMOVED
170+
<module name="MagicNumber"/>
171+
-->
172+
<module name="MissingSwitchDefault"/>
173+
<module name="MultipleVariableDeclarations"/>
174+
<module name="SimplifyBooleanExpression"/>
175+
<module name="SimplifyBooleanReturn"/>
176+
177+
<!-- Checks for class design -->
178+
<!-- See https://checkstyle.org/checks/design/index.html -->
179+
<module name="DesignForExtension"/>
180+
<module name="FinalClass"/>
181+
<module name="HideUtilityClassConstructor"/>
182+
<module name="InterfaceIsType"/>
183+
<module name="VisibilityModifier"/>
184+
185+
<!-- Miscellaneous other checks. -->
186+
<!-- See https://checkstyle.org/checks/misc/index.html -->
187+
<module name="ArrayTypeStyle"/>
188+
<module name="FinalParameters"/>
189+
<module name="TodoComment"/>
190+
<module name="UpperEll"/>
191+
192+
<!-- https://checkstyle.org/filters/suppressionxpathfilter.html -->
193+
<module name="SuppressionXpathFilter">
194+
<property name="file" value="${org.checkstyle.sun.suppressionxpathfilter.config}"
195+
default="checkstyle-xpath-suppressions.xml" />
196+
<property name="optional" value="true"/>
197+
</module>
198+
199+
</module>
200+
201+
</module>

0 commit comments

Comments
 (0)