Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: spring-io/spring-javaformat
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.0.18
Choose a base ref
...
head repository: spring-io/spring-javaformat
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing 429 changed files with 16,590 additions and 4,637 deletions.
5 changes: 3 additions & 2 deletions .eclipse/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
@@ -127,7 +127,7 @@ org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=84
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
@@ -136,6 +136,7 @@ org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration
org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0
org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0
org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
org.eclipse.jdt.core.formatter.align_selector_in_method_invocation_on_expression_first_line=true
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
2 changes: 1 addition & 1 deletion .eclipse/org.eclipse.jdt.ui.prefs
Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@ org.eclipse.jdt.ui.keywordthis=false
org.eclipse.jdt.ui.ondemandthreshold=9999
org.eclipse.jdt.ui.overrideannotation=true
org.eclipse.jdt.ui.staticondemandthreshold=9999
org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*\n * Copyright 2017-2019 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https\://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n\n${package_declaration}\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\nthrow new UnsupportedOperationException("Auto-generated method stub", ${exception_var});</template><template autoinsert\="false" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\nthrow new UnsupportedOperationException("Auto-generated method stub");</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*\n * Copyright 2017-2020 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https\://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n\n${package_declaration}\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\nthrow new UnsupportedOperationException("Auto-generated method stub", ${exception_var});</template><template autoinsert\="false" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\nthrow new UnsupportedOperationException("Auto-generated method stub");</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
sp_cleanup.add_default_serial_version_id=true
sp_cleanup.add_generated_serial_version_id=false
sp_cleanup.add_missing_annotations=true
1 change: 1 addition & 0 deletions .github/actions/.bats/bats
Submodule bats added at 902578
1 change: 1 addition & 0 deletions .github/actions/.bats/test_helper/bats-assert
Submodule bats-assert added at e2d855
1 change: 1 addition & 0 deletions .github/actions/.bats/test_helper/bats-support
Submodule bats-support added at 9bf10e
21 changes: 21 additions & 0 deletions .github/actions/create-github-release/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Create GitHub Release
description: Create the release on GitHub with a changelog
inputs:
milestone:
required: true
token:
required: true
runs:
using: composite
steps:
- name: Generate Changelog
uses: spring-io/github-changelog-generator@v0.0.10
with:
milestone: ${{ inputs.milestone }}
token: ${{ inputs.token }}
config-file: .github/actions/create-github-release/changelog-generator.yml
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ inputs.token }}
shell: bash
run: gh release create ${{ format('v{0}', inputs.milestone) }} --notes-file changelog.md
2 changes: 2 additions & 0 deletions .github/actions/create-github-release/changelog-generator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
changelog:
repository: spring-io/spring-javaformat
22 changes: 22 additions & 0 deletions .github/actions/deduce-versions/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'Deduce Versions'
description: 'Deduce the version to stage and the next SNAPSHOT version'
inputs:
current-version:
required: true
release-type:
required: true
outputs:
release-version:
value: ${{ steps.deduce-versions.outputs.release-version }}
next-version:
value: ${{ steps.deduce-versions.outputs.next-version }}
runs:
using: composite
steps:
- name: Deduce Versions
id: deduce-versions
shell: bash
run: . ${{ github.action_path }}/deduce-versions.sh; deduce_versions
env:
CURRENT_VERSION: "${{ inputs.current-version }}"
RELEASE_TYPE: "${{ inputs.release-type }}"
116 changes: 116 additions & 0 deletions .github/actions/deduce-versions/deduce-versions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
#!/usr/bin/env bash

# Get the next milestone release for the given number by inspecting current tags
get_next_milestone_release() {
[[ -n $1 ]] || { echo "missing get_next_milestone_release() version argument" >&2; return 1; }
get_next_tag_based_release "$1" "M"
}

# Get the next RC release for the given number by inspecting current tags
get_next_rc_release() {
[[ -n $1 ]] || { echo "missing get_next_rc_release() version argument" >&2; return 1; }
get_next_tag_based_release "$1" "RC"
}

# Get the next release for the given number
get_next_release() {
[[ -n $1 ]] || { echo "missing get_next_release() version argument" >&2; return 1; }
if [[ $1 =~ ^(.*)\.BUILD-SNAPSHOT$ ]]; then
local join="."
else
local join="-"
fi
local version
local result
version=$( strip_snapshot_suffix "$1" )
if [[ -n $2 ]]; then
result="${version}${join}${2}"
else
result="${version}"
fi
echo $result
}

# Get the next milestone or RC release for the given number by inspecting current tags
get_next_tag_based_release() {
[[ -n $1 ]] || { echo "missing get_next_tag_based_release() version argument" >&2; return 1; }
[[ -n $2 ]] || { echo "missing get_next_tag_based_release() tag type argument" >&2; return 1; }
if [[ $1 =~ ^(.*)\.BUILD-SNAPSHOT$ ]]; then
local join="."
else
local join="-"
fi
local version
local last
version=$( strip_snapshot_suffix "$1" )
git fetch --tags --all > /dev/null
last=$( git tag --list "v${version}${join}${2}*" | sed -E "s/^.*${2}([0-9]+)$/\1/g" | sort -rn | head -n1 )
if [[ -z $last ]]; then
last="0"
fi
last="${version}${join}${2}${last}"
bump_version_number "$last"
}

# Remove any "-SNAPSHOT" or ".BUILD-SNAPSHOT" suffix
strip_snapshot_suffix() {
[[ -n $1 ]] || { echo "missing get_relase_version() argument" >&2; return 1; }
if [[ $1 =~ ^(.*)\.BUILD-SNAPSHOT$ ]]; then
echo "${BASH_REMATCH[1]}"
elif [[ $1 =~ ^(.*)-SNAPSHOT$ ]]; then
echo "${BASH_REMATCH[1]}"
else
echo "$1"
fi
}

# Bump version number by incrementing the last numeric, RC or M token
bump_version_number() {
local version=$1
[[ -n $version ]] || { echo "missing bump_version_number() argument" >&2; return 1; }
if [[ $version =~ ^(.*(\.|-)([A-Za-z]+))([0-9]+)$ ]]; then
local prefix=${BASH_REMATCH[1]}
local suffix=${BASH_REMATCH[4]}
(( suffix++ ))
echo "${prefix}${suffix}"
return 0;
fi
local suffix
if [[ $version =~ ^(.*)(\-SNAPSHOT)$ ]]; then
version=${BASH_REMATCH[1]}
suffix="-SNAPSHOT"
fi
tokens=(${version//\./ })
local bumpIndex
for i in "${!tokens[@]}"; do
if [[ "${tokens[$i]}" =~ ^[0-9]+$ ]] ; then
bumpIndex=$i
fi
done
[[ -n $bumpIndex ]] || { echo "unsupported version number" >&2; return 1; }
(( tokens[bumpIndex]++ ))
local bumpedVersion
IFS=. eval 'bumpedVersion="${tokens[*]}"'
echo "${bumpedVersion}${suffix}"
}

# Deduce versions
deduce_versions() {
[[ -n ${GITHUB_OUTPUT} ]] || { echo "missing GITHUB_OUTPUT environment variable" >&2; return 1; }
[[ -n ${CURRENT_VERSION} ]] || { echo "missing CURRENT_VERSION environment variable" >&2; return 1; }
[[ -n ${RELEASE_TYPE} ]] || { echo "missing RELEASE_TYPE environment variable" >&2; return 1; }
if [[ ${RELEASE_TYPE,,} = "milestone" ]]; then
releaseVersion=$( get_next_milestone_release ${CURRENT_VERSION})
nextVersion=${CURRENT_VERSION}
elif [[ ${RELEASE_TYPE,,} = "release-candidate" ]]; then
releaseVersion=$( get_next_rc_release ${CURRENT_VERSION})
nextVersion=${CURRENT_VERSION}
elif [[ ${RELEASE_TYPE,,} = "release" ]]; then
releaseVersion=$( get_next_release ${CURRENT_VERSION})
nextVersion=$( bump_version_number ${CURRENT_VERSION})
else
echo "Unknown release type '${RELEASE_TYPE}'" >&2; exit 1;
fi
echo "release-version=${releaseVersion}" >> "$GITHUB_OUTPUT"
echo "next-version=${nextVersion}" >> "$GITHUB_OUTPUT"
}
1 change: 1 addition & 0 deletions .github/actions/deduce-versions/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
../.bats/bats/bin/bats test/*.bats
Loading