Skip to content

formatting and stylecheck enforce #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,46 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<checkstyleRules>
<module name="Checker">
<module name="RegexpHeader">
<property name="header" value="${checkstyle.header.template}"/>
<property name="fileExtensions" value="${checkstyle.header.extensions}"/>
</module>
<module name="TreeWalker">
<module name="RegexpSinglelineJava">
<property name="format" value="@author"/>
<property name="message" value="No @author tag allowed"/>
</module>
</module>
</module>
</checkstyleRules>
<outputFile>${project.build.directory}/checkstyle.log</outputFile>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<includeResources>true</includeResources>
<includeTestResources>true</includeTestResources>
<consoleOutput>false</consoleOutput>
<failsOnError>false</failsOnError>
<logViolationsToConsole>${checkstyle.logViolationsToConsole}</logViolationsToConsole>
<failOnViolation>${checkstyle.failOnViolation}</failOnViolation>
<sourceDirectories>
<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
<sourceDirectory>${project.build.testSourceDirectory}</sourceDirectory>
</sourceDirectories>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
/*
* Copyright 2020-Present The Serverless Workflow Specification Authors
* <p>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
*
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package io.serverlessworkflow.api.deserializers;

Expand Down Expand Up @@ -47,7 +46,7 @@ public CronDeserializer(WorkflowPropertySource context) {

@Override
public Cron deserialize(JsonParser jp,
DeserializationContext ctxt) throws IOException {
DeserializationContext ctxt) throws IOException {

JsonNode node = jp.getCodec().readTree(jp);

Expand All @@ -57,11 +56,11 @@ public Cron deserialize(JsonParser jp,
cron.setExpression(node.asText());
return cron;
} else {
if(node.get("expression") != null) {
if (node.get("expression") != null) {
cron.setExpression(node.get("expression").asText());
}

if(node.get("validUntil") != null) {
if (node.get("validUntil") != null) {
cron.setValidUntil(node.get("validUntil").asText());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
/*
* Copyright 2020-Present The Serverless Workflow Specification Authors
* <p>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
*
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package io.serverlessworkflow.api.deserializers;

Expand All @@ -22,6 +21,7 @@
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import io.serverlessworkflow.api.datainputschema.DataInputSchema;
import io.serverlessworkflow.api.interfaces.WorkflowPropertySource;

import java.io.IOException;

public class DataInputSchemaDeserializer extends StdDeserializer<DataInputSchema> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
/*
* Copyright 2020-Present The Serverless Workflow Specification Authors
* <p>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
*
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package io.serverlessworkflow.api.deserializers;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
/*
* Copyright 2020-Present The Serverless Workflow Specification Authors
* <p>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
*
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package io.serverlessworkflow.api.deserializers;

Expand Down Expand Up @@ -52,7 +51,7 @@ public EndDefinitionDeserializer(WorkflowPropertySource context) {

@Override
public End deserialize(JsonParser jp,
DeserializationContext ctxt) throws IOException {
DeserializationContext ctxt) throws IOException {

ObjectMapper mapper = (ObjectMapper) jp.getCodec();
JsonNode node = jp.getCodec().readTree(jp);
Expand All @@ -65,21 +64,21 @@ public End deserialize(JsonParser jp,
end.setTerminate(false);
return node.asBoolean() ? end : null;
} else {
if(node.get("produceEvents") != null) {
List<ProduceEvent> produceEvents= new ArrayList<>();
if (node.get("produceEvents") != null) {
List<ProduceEvent> produceEvents = new ArrayList<>();
for (final JsonNode nodeEle : node.get("produceEvents")) {
produceEvents.add(mapper.treeToValue(nodeEle, ProduceEvent.class));
}
end.setProduceEvents(produceEvents);
}

if(node.get("terminate") != null) {
if (node.get("terminate") != null) {
end.setTerminate(node.get("terminate").asBoolean());
} else {
end.setTerminate(false);
}

if(node.get("compensate") != null) {
if (node.get("compensate") != null) {
end.setCompensate(node.get("compensate").asBoolean());
} else {
end.setCompensate(false);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
/*
* Copyright 2020-Present The Serverless Workflow Specification Authors
* <p>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
*
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package io.serverlessworkflow.api.deserializers;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
/*
* Copyright 2020-Present The Serverless Workflow Specification Authors
* <p>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
*
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package io.serverlessworkflow.api.deserializers;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
/*
* Copyright 2020-Present The Serverless Workflow Specification Authors
* <p>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
*
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package io.serverlessworkflow.api.deserializers;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
/*
* Copyright 2020-Present The Serverless Workflow Specification Authors
* <p>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
*
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package io.serverlessworkflow.api.deserializers;

Expand Down Expand Up @@ -48,7 +47,7 @@ public FunctionDefinitionTypeDeserializer(Class<?> vc) {

@Override
public FunctionDefinition.Type deserialize(JsonParser jp,
DeserializationContext ctxt) throws IOException {
DeserializationContext ctxt) throws IOException {

String value = jp.getText();
if (context != null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
/*
* Copyright 2020-Present The Serverless Workflow Specification Authors
* <p>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
*
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package io.serverlessworkflow.api.deserializers;

Expand Down Expand Up @@ -48,7 +47,7 @@ public FunctionRefDeserializer(WorkflowPropertySource context) {

@Override
public FunctionRef deserialize(JsonParser jp,
DeserializationContext ctxt) throws IOException {
DeserializationContext ctxt) throws IOException {

ObjectMapper mapper = (ObjectMapper) jp.getCodec();
JsonNode node = jp.getCodec().readTree(jp);
Expand All @@ -60,11 +59,11 @@ public FunctionRef deserialize(JsonParser jp,
functionRef.setArguments(null);
return functionRef;
} else {
if(node.get("arguments") != null) {
if (node.get("arguments") != null) {
functionRef.setArguments(mapper.treeToValue(node.get("arguments"), JsonNode.class));
}

if(node.get("refName") != null) {
if (node.get("refName") != null) {
functionRef.setRefName(node.get("refName").asText());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
/*
* Copyright 2020-Present The Serverless Workflow Specification Authors
* <p>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
*
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package io.serverlessworkflow.api.deserializers;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
/*
* Copyright 2020-Present The Serverless Workflow Specification Authors
* <p>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
*
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package io.serverlessworkflow.api.deserializers;

Expand Down Expand Up @@ -48,7 +47,7 @@ public OnEventsActionModeDeserializer(Class<?> vc) {

@Override
public OnEvents.ActionMode deserialize(JsonParser jp,
DeserializationContext ctxt) throws IOException {
DeserializationContext ctxt) throws IOException {

String value = jp.getText();
if (context != null) {
Expand Down
Loading