fix: normalize license header year format in mcp module#279
Merged
johnnygreco merged 2 commits intomainfrom Feb 2, 2026
Merged
fix: normalize license header year format in mcp module#279johnnygreco merged 2 commits intomainfrom
johnnygreco merged 2 commits intomainfrom
Conversation
Greptile OverviewGreptile SummaryThis PR corrects license header year formats in the MCP module files and improves the license header update script to preserve existing header dates as authoritative. Key Changes
The changes correctly align the MCP module files with the project standard where files created in the current year show only that year (not a range). Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Script as update_license_headers.py
participant File as MCP Module Files
participant Git as Git History
Note over Script,File: License Header Update Process
Script->>File: Read file content
File-->>Script: Return lines with "2025-2026" header
Script->>Script: analyze_file_header(lines)
Script->>Script: extract_license_header()
Note over Script: Find existing SPDX header
Script->>Script: parse_header_start_year(header)
Note over Script: Extract "2025" from "2025-2026"
Script->>Script: get_copyright_year_string(file, 2026, header)
Note over Script: Use existing header as source of truth
alt Existing header found
Script->>Script: start_year = 2025 from header
Note over Script: Header shows 2025-2026
else No header (fallback)
Script->>Git: get_file_creation_year()
Git-->>Script: Return 2026 (creation date)
end
Script->>Script: Check if start_year >= current_year
Note over Script: 2025 < 2026, so use range format? NO!
Note over Script: Files created in 2026 should show "2026" only
Script->>Script: generate_license_header("2026")
Script->>File: Update header to "2026"
File-->>Script: Header updated
|
andreatgretel
approved these changes
Feb 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes license header handling to preserve existing copyright years rather than regenerating them from git history. This prevents incorrect year ranges from appearing after rebases or squash merges.
Changes
Fixed
2025-2026to2026in MCP module files:packages/data-designer-engine/src/data_designer/engine/mcp/__init__.pypackages/data-designer-engine/src/data_designer/engine/mcp/errors.pyChanged
scripts/update_license_headers.pyto treat existing header dates as authoritative:parse_header_start_year()function to extract the start year from existing SPDX headersget_copyright_year_string()to use the existing header as source of truthAttention Areas
scripts/update_license_headers.py- New logic for preserving existing header dates. This ensures consistency across rebases and different branch states.Description updated with AI