You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add ignore_year2 behavior with header creation/update edge-case handling
* Fix year-format API regression and remove ignore_year2 fixture dependency
* Remove ignore_year2 and add ignore_year1 behavioral tests
- Remove all ignore_year2/IgnoreYear2 references from config, tests, init template, and README
- Add explicit tests documenting that ignore_year1 suppresses start-year updates on existing headers but does not affect new-file header creation (addlicense always uses config year)
- Fix stale extra argument in TestCalculateYearUpdates left over from ignore_year2 removal
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Document ignore_year1 effect on LICENSE file headers in README
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Remove redundant FormatCopyrightYears in favour of FormatCopyrightYearsForNewHeaders
Both were identical wrappers; FormatCopyrightYears had no production callers.
Consolidate to the single function used in production and update tests.
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
-**Start Year**: Auto-detected from config file and if not found defaults to repository's first commit
91
93
-**End Year**: Set to current year when an update is triggered (git history only determines if update is needed)
92
94
-**Update Trigger**: Git detects if source code file was modified since the copyright end year
@@ -105,15 +107,19 @@ to validate if a repo is in compliance or not.
105
107
### Copyright Year Logic
106
108
107
109
**Source File Headers:**
110
+
108
111
- End year: Set to current year when file's source code is modified
109
112
- Git history determines if update is needed (compares file's last commit year to copyright end year)
110
113
- When triggered, end year updates to current year
114
+
- If project.ignore_year1 is true, start-year updates are skipped
111
115
112
116
**LICENSE Files:**
117
+
113
118
- End year: Set to current year when any project file is modified
114
119
- Git history determines if update is needed (compares repo's last commit year to copyright end year)
115
120
- When triggered, end year updates to current year
116
121
- Preserves historical accuracy for archived projects (no forced updates)
122
+
- If project.ignore_year1 is true, start-year updates are skipped (same behaviour as source file headers)
117
123
118
124
**Key Distinction:** Git history is used as a trigger to determine *whether* an update is needed, but the actual end year value is always set to the current year when an update occurs.
119
125
@@ -151,6 +157,11 @@ project {
151
157
# Default: 0 (auto-detect)
152
158
# copyright_year = 0
153
159
160
+
# (OPTIONAL) Ignore updates to the first year (start year) in copyright ranges.
161
+
# This does not change how end year is resolved.
162
+
# Default: false
163
+
# ignore_year1 = false
164
+
154
165
# (OPTIONAL) A list of globs that should not have copyright or license headers .
155
166
# Supports doublestar glob patterns for more flexibility in defining which
156
167
# files or folders should be ignored
@@ -196,7 +207,6 @@ Note: Using fetch-depth parameter is mandatory as the tool will not be able to e
196
207
**Impact of not updating year information:**
197
208
If year information is not updated time to time, then the repo can be out of compliance. IBM policy suggests keeping source code files updated with latest year of code changes in a source code file.
0 commit comments