Skip to content

Commit 02b226d

Browse files
authored
Updating Java SDK to CDEvents Spec v0.1.0 (#14)
1 parent f915e5a commit 02b226d

File tree

13 files changed

+2358
-421
lines changed

13 files changed

+2358
-421
lines changed

.github/linters/sun_checks.xml

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

.github/workflows/linter.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
- name: Lint Code Base
1616
uses: github/super-linter/slim@v4
1717
env:
18-
VALIDATE_ALL_CODEBASE: true
18+
FILTER_REGEX_INCLUDE: .*src/main/.*
19+
VALIDATE_ALL_CODEBASE: false
1920
DEFAULT_BRANCH: main
2021
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,7 @@ hs_err_pid*
2626
.settings/
2727
.classpath
2828
.project
29+
30+
# IntelliJ files
31+
.idea
32+
*.iml

pom.xml

Lines changed: 45 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>dev.cdevents</groupId>
77
<artifactId>cdevents-sdk-java</artifactId>
@@ -16,6 +16,7 @@
1616
<cloudevents.version>2.3.0</cloudevents.version>
1717
<junit-jupiter.version>5.8.2</junit-jupiter.version>
1818
<assertj-core.version>3.22.0</assertj-core.version>
19+
<jackson.version>2.13.2</jackson.version>
1920
</properties>
2021

2122
<dependencies>
@@ -24,33 +25,52 @@
2425
<artifactId>cloudevents-core</artifactId>
2526
<version>${cloudevents.version}</version>
2627
</dependency>
27-
28+
2829
<!-- Test dependencies -->
29-
<dependency>
30-
<groupId>org.junit.jupiter</groupId>
31-
<artifactId>junit-jupiter</artifactId>
32-
<version>${junit-jupiter.version}</version>
33-
<scope>test</scope>
34-
</dependency>
35-
36-
<dependency>
37-
<groupId>org.assertj</groupId>
38-
<artifactId>assertj-core</artifactId>
39-
<version>${assertj-core.version}</version>
40-
<scope>test</scope>
41-
</dependency>
30+
<dependency>
31+
<groupId>org.junit.jupiter</groupId>
32+
<artifactId>junit-jupiter</artifactId>
33+
<version>${junit-jupiter.version}</version>
34+
<scope>test</scope>
35+
</dependency>
36+
37+
<dependency>
38+
<groupId>org.assertj</groupId>
39+
<artifactId>assertj-core</artifactId>
40+
<version>${assertj-core.version}</version>
41+
<scope>test</scope>
42+
</dependency>
43+
44+
<dependency>
45+
<groupId>com.fasterxml.jackson.core</groupId>
46+
<artifactId>jackson-databind</artifactId>
47+
<version>${jackson.version}</version>
48+
</dependency>
49+
50+
<dependency>
51+
<groupId>org.slf4j</groupId>
52+
<artifactId>slf4j-api</artifactId>
53+
<version>2.0.6</version>
54+
</dependency>
55+
56+
<dependency>
57+
<groupId>org.slf4j</groupId>
58+
<artifactId>slf4j-log4j12</artifactId>
59+
<version>2.0.6</version>
60+
</dependency>
61+
4262
</dependencies>
4363
<build>
44-
<finalName>maven-unit-test</finalName>
45-
<plugins>
64+
<finalName>maven-unit-test</finalName>
65+
<plugins>
4666

47-
<plugin>
48-
<groupId>org.apache.maven.plugins</groupId>
49-
<artifactId>maven-surefire-plugin</artifactId>
50-
<version>2.22.0</version>
51-
</plugin>
67+
<plugin>
68+
<groupId>org.apache.maven.plugins</groupId>
69+
<artifactId>maven-surefire-plugin</artifactId>
70+
<version>2.22.0</version>
71+
</plugin>
5272

53-
</plugins>
54-
</build>
73+
</plugins>
74+
</build>
5575

5676
</project>

0 commit comments

Comments
 (0)