Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Group 6 Client project 2023
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Hammond
Group 6 Client project 2023
Commits
081c628b
Commit
081c628b
authored
1 year ago
by
David Hammond
Browse files
Options
Downloads
Patches
Plain Diff
adding checkstyle
parent
16192651
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cms/Config/checkstyleMain.xml
+206
-0
206 additions, 0 deletions
cms/Config/checkstyleMain.xml
cms/build.gradle
+17
-0
17 additions, 0 deletions
cms/build.gradle
with
223 additions
and
0 deletions
cms/Config/checkstyleMain.xml
0 → 100644
+
206
−
0
View file @
081c628b
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<!--
Checkstyle configuration that checks the sun coding conventions from:
- the Java Language Specification at
https://docs.oracle.com/javase/specs/jls/se11/html/index.html
- the Sun Code Conventions at https://www.oracle.com/technetwork/java/codeconvtoc-136057.html
- the Javadoc guidelines at
https://www.oracle.com/technetwork/java/javase/documentation/index-137868.html
- the JDK Api documentation https://docs.oracle.com/en/java/javase/11/
- some best practices
Checkstyle is very configurable. Be sure to read the documentation at
https://checkstyle.org (or in your downloaded distribution).
Most Checks are configurable, be sure to consult the documentation.
To completely disable a check, just comment it out or delete it from the file.
To suppress certain violations please review suppression filters.
Finally, it is worth reading the documentation.
-->
<module
name=
"Checker"
>
<!--
If you set the basedir property below, then all reported file
names will be relative to the specified directory. See
https://checkstyle.org/5.x/config.html#Checker
<property name="basedir" value="${basedir}"/>
-->
<property
name=
"severity"
value=
"error"
/>
<property
name=
"fileExtensions"
value=
"java, properties, xml"
/>
<!-- Excludes all 'module-info.java' files -->
<!-- See https://checkstyle.org/config_filefilters.html -->
<module
name=
"BeforeExecutionExclusionFileFilter"
>
<property
name=
"fileNamePattern"
value=
"module\-info\.java$"
/>
</module>
<!-- https://checkstyle.org/config_filters.html#SuppressionFilter -->
<module
name=
"SuppressionFilter"
>
<property
name=
"file"
value=
"${org.checkstyle.sun.suppressionfilter.config}"
default=
"checkstyle-suppressions.xml"
/>
<property
name=
"optional"
value=
"true"
/>
</module>
<!-- Checks that a package-info.java file exists for each package. -->
<!-- See https://checkstyle.org/config_javadoc.html#JavadocPackage -->
<module
name=
"JavadocPackage"
/>
<!-- Checks whether files end with a new line. -->
<!-- See https://checkstyle.org/config_misc.html#NewlineAtEndOfFile -->
<module
name=
"NewlineAtEndOfFile"
/>
<!-- Checks that property files contain the same keys. -->
<!-- See https://checkstyle.org/config_misc.html#Translation -->
<module
name=
"Translation"
/>
<!-- Checks for Size Violations. -->
<!-- See https://checkstyle.org/config_sizes.html -->
<module
name=
"FileLength"
/>
<!-- Checks for whitespace -->
<!-- See https://checkstyle.org/config_whitespace.html -->
<module
name=
"FileTabCharacter"
/>
<!-- Miscellaneous other checks. -->
<!-- See https://checkstyle.org/config_misc.html -->
<module
name=
"RegexpSingleline"
>
<property
name=
"format"
value=
"\s+$"
/>
<property
name=
"minimum"
value=
"0"
/>
<property
name=
"maximum"
value=
"0"
/>
<property
name=
"message"
value=
"Line has trailing spaces."
/>
</module>
<!-- Checks for Headers -->
<!-- See https://checkstyle.org/config_header.html -->
<!-- <module name="Header"> -->
<!-- <property name="headerFile" value="${checkstyle.header.file}"/> -->
<!-- <property name="fileExtensions" value="java"/> -->
<!-- </module> -->
<module
name=
"TreeWalker"
>
<!-- Checks for Javadoc comments. -->
<!-- See https://checkstyle.org/config_javadoc.html -->
<module
name=
"InvalidJavadocPosition"
/>
<module
name=
"JavadocMethod"
/>
<module
name=
"JavadocType"
/>
<module
name=
"JavadocVariable"
/>
<module
name=
"JavadocStyle"
/>
<module
name=
"MissingJavadocMethod"
/>
<!-- Checks for Naming Conventions. -->
<!-- See https://checkstyle.org/config_naming.html -->
<module
name=
"ConstantName"
/>
<module
name=
"LocalFinalVariableName"
/>
<module
name=
"LocalVariableName"
/>
<module
name=
"MemberName"
/>
<module
name=
"MethodName"
/>
<module
name=
"PackageName"
/>
<module
name=
"ParameterName"
/>
<module
name=
"StaticVariableName"
/>
<module
name=
"TypeName"
/>
<!-- Checks for imports -->
<!-- See https://checkstyle.org/config_import.html -->
<module
name=
"AvoidStarImport"
/>
<module
name=
"IllegalImport"
/>
<!-- defaults to sun.* packages -->
<module
name=
"RedundantImport"
/>
<module
name=
"UnusedImports"
>
<property
name=
"processJavadoc"
value=
"false"
/>
</module>
<!-- Checks for Size Violations. -->
<!-- See https://checkstyle.org/config_sizes.html -->
<module
name=
"MethodLength"
/>
<module
name=
"ParameterNumber"
/>
<!-- Checks for whitespace -->
<!-- See https://checkstyle.org/config_whitespace.html -->
<module
name=
"EmptyForIteratorPad"
/>
<module
name=
"GenericWhitespace"
/>
<!--
<module name="MethodParamPad"/>
-->
<!--
<module name="NoWhitespaceAfter"/>
-->
<!--
<module name="NoWhitespaceBefore"/>
-->
<module
name=
"OperatorWrap"
/>
<module
name=
"ParenPad"
/>
<module
name=
"TypecastParenPad"
/>
<!--
<module name="WhitespaceAfter"/>
-->
<!--
<module name="WhitespaceAround"/>
-->
<!-- Modifier Checks -->
<!-- See https://checkstyle.org/config_modifiers.html -->
<module
name=
"ModifierOrder"
/>
<module
name=
"RedundantModifier"
/>
<!-- Checks for blocks. You know, those {}'s -->
<!-- See https://checkstyle.org/config_blocks.html -->
<module
name=
"AvoidNestedBlocks"
/>
<module
name=
"EmptyBlock"
/>
<module
name=
"LeftCurly"
/>
<module
name=
"NeedBraces"
/>
<module
name=
"RightCurly"
/>
<!-- Checks for common coding problems -->
<!-- See https://checkstyle.org/config_coding.html -->
<module
name=
"EmptyStatement"
/>
<module
name=
"EqualsHashCode"
/>
<module
name=
"HiddenField"
/>
<module
name=
"IllegalInstantiation"
/>
<module
name=
"InnerAssignment"
/>
<!-- module name="MagicNumber"/-->
<module
name=
"MissingSwitchDefault"
/>
<module
name=
"MultipleVariableDeclarations"
/>
<module
name=
"SimplifyBooleanExpression"
/>
<module
name=
"SimplifyBooleanReturn"
/>
<!-- Checks for class design -->
<!-- See https://checkstyle.org/config_design.html -->
<module
name=
"DesignForExtension"
/>
<module
name=
"FinalClass"
/>
<module
name=
"HideUtilityClassConstructor"
/>
<module
name=
"InterfaceIsType"
/>
<module
name=
"VisibilityModifier"
/>
<!-- Miscellaneous other checks. -->
<!-- See https://checkstyle.org/config_misc.html -->
<module
name=
"ArrayTypeStyle"
/>
<module
name=
"FinalParameters"
/>
<module
name=
"TodoComment"
/>
<module
name=
"UpperEll"
/>
<!-- https://checkstyle.org/config_filters.html#SuppressionXpathFilter -->
<module
name=
"SuppressionXpathFilter"
>
<property
name=
"file"
value=
"${org.checkstyle.sun.suppressionxpathfilter.config}"
default=
"checkstyle-xpath-suppressions.xml"
/>
<property
name=
"optional"
value=
"true"
/>
</module>
</module>
</module>
This diff is collapsed.
Click to expand it.
cms/build.gradle
+
17
−
0
View file @
081c628b
...
...
@@ -2,6 +2,7 @@ plugins {
id
'java'
id
'org.springframework.boot'
version
'3.1.5'
id
'io.spring.dependency-management'
version
'1.1.3'
id
'checkstyle'
}
group
=
'com.project'
...
...
@@ -50,3 +51,19 @@ tasks.named('bootBuildImage') {
tasks
.
named
(
'test'
)
{
useJUnitPlatform
()
}
//tool configuration
checkstyle
{
toolVersion
=
9.2
checkstyleMain
.
enabled
=
true
checkstyleTest
.
enabled
=
false
}
checkstyleMain
{
configFile
=
file
(
"config/checkstyleMain.xml"
)
maxErrors
=
1000
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment