mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
41f35ef6b3
Historically, we have used `<introduction year>-<modification year>` as
the pattern for copyright headers.
For example: `Copyright 2002-2025 the original author or authors.`
However, we have been encouraged to use `present` as the modification
year.
In light of that, this commit updates the following to enforce the new
pattern.
- The patterns in our SpringHeaderCheck Checkstyle rules
- The `Copyright 2002-${year}` template in org.eclipse.jdt.ui.prefs
- The update_copyright_headers.sh script
See gh-35070
17 lines
538 B
Bash
Executable File
17 lines
538 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# This shell script updates the copyright headers in source code files
|
|
# in the current branch so that the headers conform to the pattern:
|
|
# <start-year>-present.
|
|
#
|
|
# For example, "Copyright 2002-2025" will be replaced with
|
|
# "Copyright 2002-current".
|
|
#
|
|
# This has only been tested on mac OS.
|
|
|
|
echo Updating copyright headers in Java, Kotlin, and Groovy source code
|
|
|
|
for file in $(find -E . -type f -regex '.+\.(java|kt|groovy)$' | uniq); do
|
|
sed -i '' -E "s/Copyright ([0-9]{4})-[0-9]{4}/Copyright \1-present/g" $file;
|
|
done
|