Skip to content

Commit bced0f1

Browse files
authored
Merge pull request #12 from lyndonb-bq/lyndon/unit-test-updates
AN-822 Unit tests and checkstyle updates
2 parents 800d01e + 3184e36 commit bced0f1

42 files changed

Lines changed: 1368 additions & 400 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
### Summary
2+
3+
<!--- General summary / title -->
4+
5+
### Description
6+
7+
<!--- Details of what you changed -->
8+
9+
### Related Issue
10+
11+
<!--- Link to issue where this is tracked -->
12+
13+
### Additional Reviewers
14+
@lyndonb-bq
15+
@xiazcy

.github/workflows/maven.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: SQL-Gremlin Maven Build
19+
20+
on:
21+
# Trigger the workflow on push or pull request,
22+
# but only for the master branch
23+
push:
24+
branches:
25+
- master
26+
- develop
27+
pull_request:
28+
branches:
29+
- master
30+
- develop
31+
jobs:
32+
build:
33+
runs-on: ubuntu-latest
34+
35+
steps:
36+
- uses: actions/checkout@v2
37+
- name: Set up JDK 1.8
38+
uses: actions/setup-java@v1
39+
with:
40+
java-version: 1.8
41+
- name: Maven Build
42+
run: mvn -B verify --file pom.xml
43+
- name: Copy Build
44+
run: |
45+
mkdir jarfile
46+
cp target/*.jar jarfile
47+
- name: Upload Build
48+
uses: actions/upload-artifact@v1
49+
with:
50+
name: jarfile
51+
path: jarfile
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# Adapted from https://github.com/marketplace/actions/remove-artifacts (available under MIT license)
19+
20+
name: Remove Old Artifacts
21+
22+
on:
23+
schedule:
24+
# Every day at 1am
25+
- cron: '0 1 * * *'
26+
27+
jobs:
28+
remove-old-artifacts:
29+
runs-on: ubuntu-latest
30+
timeout-minutes: 10
31+
32+
steps:
33+
- name: Remove Old Artifacts
34+
uses: c-hive/gha-remove-artifacts@v1
35+
with:
36+
age: '1 day'
37+
# skip-tags will prevent tags (i.e releases) from being deleted.
38+
skip-tags: true

checkstyle/checkstyle-rules.xml

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE module PUBLIC
3+
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
4+
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
5+
6+
<!--
7+
Recommended check style configuration for Neptune packages.
8+
9+
This checkstyle configuration is based on Google Java style guide
10+
with additional customizations and best practices.
11+
12+
- Google Java Style
13+
http://google.github.io/styleguide/javaguide.html
14+
15+
The rules enforced are very minimal and not very annoying. Please
16+
modify this if you think a particular rule is not adding much value
17+
instead of disabling checkstyle.
18+
19+
Checkstyle is very configurable. Be sure to read the documentation at
20+
http://checkstyle.sf.net (or in your downloaded distribution).
21+
-->
22+
<module name="Checker">
23+
24+
<property name="charset" value="UTF-8"/>
25+
26+
<!-- Checks whether files end with a new line. -->
27+
<!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
28+
<module name="NewlineAtEndOfFile"/>
29+
30+
<!-- Checks for Size Violations. -->
31+
<!-- See http://checkstyle.sf.net/config_sizes.html -->
32+
<module name="FileLength"/>
33+
34+
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
35+
<module name="FileTabCharacter"/>
36+
37+
<module name="RegexpSingleline">
38+
<property name="format" value="\s+$"/>
39+
<property name="message" value="Line has trailing spaces."/>
40+
</module>
41+
42+
<!-- Supressions file -->
43+
<module name="SuppressionFilter">
44+
<property name="file" value="./checkstyle/suppressions.xml"/>
45+
</module>
46+
47+
<module name="SuppressWarningsFilter"/>
48+
49+
<module name="TreeWalker">
50+
51+
<!-- Suppress checkstyle using @SuppressWarnings -->
52+
<module name="SuppressWarningsHolder"/>
53+
54+
<!-- Suppress checkstyle using // CHECKSTYLE.OFF -->
55+
<module name="SuppressionCommentFilter">
56+
<property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
57+
<property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/>
58+
<property name="checkFormat" value="$1"/>
59+
</module>
60+
61+
<!-- To configure the check so that it matches default IntelliJ IDEA formatter configuration (tested on v14):
62+
63+
- group of static imports is on the bottom
64+
- groups of non-static imports: all imports except of "javax" and "java", then "javax" and "java"
65+
- imports will be sorted in the groups
66+
- groups are separated by, at least, one blank line
67+
68+
Note: "separated" option is disabled because IDEA default has blank line between "java" and static imports,
69+
and no blank line between "javax" and "java"
70+
-->
71+
<module name="CustomImportOrder">
72+
<property name="customImportOrderRules"
73+
value="THIRD_PARTY_PACKAGE###SPECIAL_IMPORTS###STANDARD_JAVA_PACKAGE###STATIC"/>
74+
<property name="specialImportsRegExp" value="^javax\."/>
75+
<property name="standardPackageRegExp" value="^java\."/>
76+
<property name="sortImportsInGroupAlphabetically" value="true"/>
77+
<property name="separateLineBetweenGroups" value="false"/>
78+
</module>
79+
80+
81+
<!-- Checks for Size Violations. -->
82+
<!-- See http://checkstyle.sf.net/config_sizes.html -->
83+
<module name="LineLength">
84+
<property name="max" value="120"/>
85+
<property name="ignorePattern" value="(^ *\** *)|(^import )"/>
86+
</module>
87+
<!-- <module name="MethodLength"/>-->
88+
<!-- <module name="ParameterNumber"/>-->
89+
90+
<module name="NonEmptyAtclauseDescription"/>
91+
92+
<!-- Checks for Naming Conventions. -->
93+
<!-- See http://checkstyle.sf.net/config_naming.html -->
94+
<module name="ConstantName"/>
95+
<module name="LocalFinalVariableName"/>
96+
<module name="LocalVariableName"/>
97+
<module name="MemberName"/>
98+
<module name="MethodName"/>
99+
<module name="PackageName"/>
100+
<module name="ParameterName"/>
101+
<module name="StaticVariableName"/>
102+
<module name="TypeName"/>
103+
104+
<!-- Checks for imports -->
105+
<!-- See http://checkstyle.sf.net/config_import.html -->
106+
<module name="AvoidStarImport"/>
107+
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
108+
<module name="RedundantImport"/>
109+
<module name="UnusedImports"/>
110+
111+
<!-- Modifier Checks -->
112+
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
113+
<module name="ModifierOrder"/>
114+
<module name="RedundantModifier"/>
115+
116+
<!-- Checks for blocks. You know, those {}'s -->
117+
<!-- See http://checkstyle.sf.net/config_blocks.html -->
118+
<module name="EmptyBlock"/>
119+
<module name="LeftCurly"/>
120+
<module name="NeedBraces"/>
121+
<module name="RightCurly"/>
122+
123+
<!-- Checks for whitespace -->
124+
<module name="MethodParamPad"/>
125+
126+
<!-- Checks for common coding problems -->
127+
<module name="HiddenField">
128+
<property name="tokens" value="VARIABLE_DEF"/>
129+
</module>
130+
131+
<!-- Checks for class design -->
132+
<!-- See http://checkstyle.sf.net/config_design.html -->
133+
<module name="FinalClass"/>
134+
<module name="VisibilityModifier"/>
135+
136+
<!-- Miscellaneous other checks -->
137+
<module name="ArrayTypeStyle"/>
138+
<module name="UpperEll"/>
139+
<module name="FinalParameters"/>
140+
<module name="FinalLocalVariable"/>
141+
<module name="CommentsIndentation"/>
142+
<module name="WhitespaceAround"/>
143+
<module name="TodoComment">
144+
<property name="severity" value="warning"/>
145+
<property name="format" value="(TODO)|(FIXME)"/>
146+
</module>
147+
148+
<module name="EqualsAvoidNullCheck"/>
149+
</module>
150+
</module>

checkstyle/suppressions.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?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">
6+
7+
<suppressions>
8+
<suppress files="\\*.iml" checks="[a-zA-Z0-9]*"/>
9+
<suppress files="\\*.template" checks="[a-zA-Z0-9]*"/>
10+
<suppress files="\\*.yaml" checks="[a-zA-Z0-9]*"/>
11+
<suppress files="\\*.properties" checks="[a-zA-Z0-9]*"/>
12+
</suppressions>

0 commit comments

Comments
 (0)