Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/BRANCH_POLICY.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ Edit `downstreamBranches` and `syncGithubFromMasterTargets` there when adding a

## Branch names

- **`canary`** (lowercase) is used by `build.yml` and `release.yml`.
- **`canary`** (lowercase) is used by `build.yml` and `release-canary.yml`.
- **`Canary`** (capital C) is used by `canary.yml` only.
- Policy treats both as downstream lines; prefer consolidating to one branch name over time.
32 changes: 15 additions & 17 deletions .github/PULL_REQUEST_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<!--
Suggested PR title: Feature: <Short imperative title> (#<issue>)
Suggested title: `Feature: short imperative title (#ISSUE)`

Delete any section that does not apply.
-->

## Summary

<1-3 sentences describing what changed and why it matters to consumers of the toolkit.>
What changed, and why it matters to consumers of the toolkit.

## Related issues

- Closes #<issue>
- Closes #ISSUE

## Type of change

Expand All @@ -18,8 +17,7 @@ Delete any section that does not apply.

## Changes

- <Notable change 1, grouped by area/project.>
- <Notable change 2.>
- Notable change, grouped by area or project.

## Affected packages & target frameworks

Expand All @@ -28,39 +26,39 @@ Delete any section that does not apply.

## Validation

- TestForm demo: `<FormName>` (registered in `StartScreen.AddButtons()`).
- TestForm demo: `FormName` (registered in `StartScreen.AddButtons()`).
- Manual steps:
1. <step>
2. <expected result>
1. Step
2. Expected result
- Build: `dotnet build ".\Source\Krypton Components\Krypton Toolkit Suite 2022 - VS2022.sln" -c Debug`

## Screenshots / GIFs

<!-- Capture per AGENTS.md into Documents/PR/<issue>-<short-title>-<state>.png or .gif. Do not upload or attach images to this GitHub pull request. -->
Save stills or GIFs as `Documents/PR/ISSUE-short-title-state.png` (or `.gif`). Do not upload or attach them to this pull request. Remove this section when there is no UI change.

- Local draft path: `Documents/PR/<issue>-<short-title>-<state>.png` (or N/A — no UI change)
- Local draft path: `Documents/PR/ISSUE-short-title-state.png` (or N/A — no UI change)

## Changelog

- Entry added to `Documents/Changelog/Changelog.md`:

```markdown
- Implemented [#<issue>](https://github.com/Krypton-Suite/Standard-Toolkit/issues/<issue>), <short user-facing summary>.
- Implemented [#ISSUE](https://github.com/Krypton-Suite/Standard-Toolkit/issues/ISSUE), short user-facing summary.
```

## Breaking changes & migration

<None, or describe what broke and exactly what consumers must update.>
None, or describe what broke and what consumers must update.

## Developer documentation

- `Documents/Development/<guide>.md` (add for substantial new features; omit for trivial enhancements).
- `Documents/Development/guide.md` (add for substantial new features; omit for trivial enhancements).

## Build log

<!-- Capture per AGENTS.md Build Log Screenshot. Save as Documents/PR/<issue>-<short-title>-build.png. Do not upload or attach it to this GitHub pull request. -->
Save the build-log screenshot as `Documents/PR/ISSUE-short-title-build.png`. Do not upload or attach it to this pull request.

- Local draft path: `Documents/PR/<issue>-<short-title>-build.png`
- Local draft path: `Documents/PR/ISSUE-short-title-build.png`

## Checklist

Expand Down
30 changes: 14 additions & 16 deletions .github/PULL_REQUEST_TEMPLATE/fix.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<!--
Suggested PR title: Fix: <Short imperative title> (#<issue>)
Suggested title: `Fix: short imperative title (#ISSUE)`

Delete any section that does not apply.
-->

## Summary

<1-3 sentences describing what changed and why it matters to consumers of the toolkit.>
What changed, and why it matters to consumers of the toolkit.

## Related issues

- Closes #<issue>
- Closes #ISSUE

## Type of change

Expand All @@ -18,8 +17,7 @@ Delete any section that does not apply.

## Changes

- <Notable change 1, grouped by area/project.>
- <Notable change 2.>
- Notable change, grouped by area or project.

## Affected packages & target frameworks

Expand All @@ -28,35 +26,35 @@ Delete any section that does not apply.

## Validation

- TestForm demo: `<FormName>` (registered in `StartScreen.AddButtons()`), or N/A.
- TestForm demo: `FormName` (registered in `StartScreen.AddButtons()`), or N/A.
- Manual steps:
1. <step>
2. <expected result>
1. Step
2. Expected result
- Build: `dotnet build ".\Source\Krypton Components\Krypton Toolkit Suite 2022 - VS2022.sln" -c Debug`

## Screenshots / GIFs

<!-- Capture per AGENTS.md into Documents/PR/<issue>-<short-title>-<state>.png or .gif. Do not upload or attach images to this GitHub pull request. -->
Save stills or GIFs as `Documents/PR/ISSUE-short-title-state.png` (or `.gif`). Do not upload or attach them to this pull request. Remove this section when there is no UI change.

- Local draft path: `Documents/PR/<issue>-<short-title>-<state>.png` (or N/A — no UI change)
- Local draft path: `Documents/PR/ISSUE-short-title-state.png` (or N/A — no UI change)

## Changelog

- Entry added to `Documents/Changelog/Changelog.md`:

```markdown
- Resolved [#<issue>](https://github.com/Krypton-Suite/Standard-Toolkit/issues/<issue>), <short user-facing summary>.
- Resolved [#ISSUE](https://github.com/Krypton-Suite/Standard-Toolkit/issues/ISSUE), short user-facing summary.
```

## Breaking changes & migration

<None, or describe what broke and exactly what consumers must update.>
None, or describe what broke and what consumers must update.

## Build log

<!-- Capture per AGENTS.md Build Log Screenshot. Save as Documents/PR/<issue>-<short-title>-build.png. Do not upload or attach it to this GitHub pull request. -->
Save the build-log screenshot as `Documents/PR/ISSUE-short-title-build.png`. Do not upload or attach it to this pull request.

- Local draft path: `Documents/PR/<issue>-<short-title>-build.png`
- Local draft path: `Documents/PR/ISSUE-short-title-build.png`

## Checklist

Expand Down
77 changes: 70 additions & 7 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,73 @@
## Choose a pull request template
Add `&template=fix.md` or `&template=feature.md` to this page's URL and press Enter to load the bug-fix or feature template.

This repository uses separate templates for bug fixes and features. Open a compare URL with your topic branch (replace `your-branch`), or append `?template=` / `&template=` on the pull request creation page:
## Summary

- **Bug fix (`Fix`)** — Resolved changelog entries
`https://github.com/Krypton-Suite/Standard-Toolkit/compare/master...your-branch?quick_pull=1&template=fix.md`
- **Feature / enhancement (`Feature`)** — Implemented changelog entries
`https://github.com/Krypton-Suite/Standard-Toolkit/compare/master...your-branch?quick_pull=1&template=feature.md`
What changed, and why it matters to consumers of the toolkit.

For the fuller local draft (embedded screenshots and build-log images under `Documents/PR/`), copy from [`Documents/PR/TEMPLATE.md`](https://github.com/Krypton-Suite/Standard-Toolkit/blob/alpha/Documents/PR/TEMPLATE.md). Do not upload those images to the GitHub pull request.
## Related issues

- Closes #ISSUE

## Type of change

- [ ] Bug fix (`Resolved`)
- [ ] Feature / enhancement (`Implemented`)
- [ ] **Breaking change** (API removal/rename, behavior change requiring migration, assembly/namespace move)
- [ ] Documentation only

## Changes

- Notable change, grouped by area or project.

## Affected packages & target frameworks

- Packages: `Krypton.Toolkit`, `Krypton.Ribbon`, `Krypton.Navigator`, `Krypton.Workspace`, `Krypton.Docking`, `Krypton.Toolkit.Utilities`, `Krypton.Navigator.Utilities` (list only those touched).
- TFMs verified: `net472`, `net48`, `net481`, `net8.0-windows`, `net9.0-windows`, `net10.0-windows`, `net11.0-windows` (list only those built).

## Validation

- TestForm demo: `FormName` (registered in `StartScreen.AddButtons()`), or N/A.
- Manual steps:
1. Step
2. Expected result
- Build: `dotnet build ".\Source\Krypton Components\Krypton Toolkit Suite 2022 - VS2022.sln" -c Debug`

## Screenshots / GIFs

Save stills or GIFs as `Documents/PR/ISSUE-short-title-state.png` (or `.gif`). Do not upload or attach them to this pull request. Remove this section when there is no UI change. The local outline that embeds those images is [`Documents/PR/TEMPLATE.md`](https://github.com/Krypton-Suite/Standard-Toolkit/blob/alpha/Documents/PR/TEMPLATE.md) on `alpha`.

- Local draft path: `Documents/PR/ISSUE-short-title-state.png`

## Changelog

- Entry added to `Documents/Changelog/Changelog.md`. Use **Resolved** for a bug fix or **Implemented** for a feature:

```markdown
- Resolved [#ISSUE](https://github.com/Krypton-Suite/Standard-Toolkit/issues/ISSUE), short user-facing summary.
- Implemented [#ISSUE](https://github.com/Krypton-Suite/Standard-Toolkit/issues/ISSUE), short user-facing summary.
```

## Breaking changes & migration

None, or describe what broke and what consumers must update.

## Developer documentation

- `Documents/Development/guide.md` for a substantial new feature. Delete this section for a trivial fix.

## Build log

Save the build-log screenshot as `Documents/PR/ISSUE-short-title-build.png`. Do not upload or attach it to this pull request.

- Local draft path: `Documents/PR/ISSUE-short-title-build.png`

## Checklist

- [ ] Builds for `net472` and is C# 7.3 compatible where required
- [ ] New compiler/analyzer warnings in touched code addressed
- [ ] `Documents/Changelog/Changelog.md` updated
- [ ] TestForm demo added or updated when the change is observable
- [ ] `Documents/Development/` guide added for a substantial feature
- [ ] Screenshots/GIFs saved under `Documents/PR/` when there is a UI change (not attached here)
- [ ] Build log screenshot saved under `Documents/PR/` (not attached here)
- [ ] Breaking-change impact and TFM notes documented above
108 changes: 108 additions & 0 deletions .github/scripts/Update-LicenseYear.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
#requires -Version 7.0
<#
.SYNOPSIS
Updates the end year in Krypton "Modifications by Peter Wagner" license headers.

.DESCRIPTION
Scans source and template files for license year ranges on lines containing
"Modifications by Peter Wagner" and sets the end year to the target year when
it is behind. Preserves UTF-8 BOM and existing line endings (CRLF/LF).

.PARAMETER Year
The calendar year to use as the license end year. Defaults to the current year.

.PARAMETER DryRun
Report files that would be updated without writing changes.
#>
param(
[int]$Year = (Get-Date).Year,
[switch]$DryRun
)

$ErrorActionPreference = 'Stop'

$repoRoot = if ($env:GITHUB_WORKSPACE) { $env:GITHUB_WORKSPACE } else { (Get-Location).Path }
$pattern = '(Modifications by Peter Wagner[^\r\n]*?)(\d{4})(\s*-\s*)(\d{4})'
$extensions = [System.Collections.Generic.HashSet[string]]::new(
[string[]]@('.cs', '.licenseheader', '.yml', '.yaml', '.md'),
[StringComparer]::OrdinalIgnoreCase
)

function Get-FileEncoding([byte[]]$Bytes) {
if ($Bytes.Length -ge 3 -and $Bytes[0] -eq 0xEF -and $Bytes[1] -eq 0xBB -and $Bytes[2] -eq 0xBF) {
return [System.Text.UTF8Encoding]::new($true), 3
}

return [System.Text.UTF8Encoding]::new($false), 0
}

function Test-ExcludedPath([string]$FullName) {
return $FullName -match '[\\/]bin[\\/]|[\\/]obj[\\/]|[\\/]Artefacts[\\/]|[\\/]\.git[\\/]'
}

$updatedFiles = 0

Get-ChildItem -Path $repoRoot -Recurse -File | ForEach-Object {
$file = $_

if (Test-ExcludedPath $file.FullName) {
return
}

if (-not ($extensions.Contains($file.Extension) -or $file.Name -eq '.editorconfig')) {
return
}

$bytes = [System.IO.File]::ReadAllBytes($file.FullName)
if ($bytes.Length -eq 0) {
return
}

$encoding, $bomSkip = Get-FileEncoding $bytes
$content = $encoding.GetString($bytes, $bomSkip, $bytes.Length - $bomSkip)

$newContent = [regex]::Replace($content, $pattern, {
param($Match)

$startYear = [int]$Match.Groups[2].Value
$separator = $Match.Groups[3].Value
$endYear = [int]$Match.Groups[4].Value

if ($endYear -ge $Year) {
return $Match.Value
}

return "$($Match.Groups[1].Value)$startYear$separator$Year"
})

if ($newContent -eq $content) {
return
}

$updatedFiles++
$relativePath = $file.FullName.Substring($repoRoot.Length).TrimStart('\', '/')

if ($DryRun) {
Write-Host "Would update: $relativePath"
return
}

$newBytes = $encoding.GetBytes($newContent)
if ($encoding.GetPreamble().Length -gt 0) {
[System.IO.File]::WriteAllBytes($file.FullName, $encoding.GetPreamble() + $newBytes)
}
else {
[System.IO.File]::WriteAllBytes($file.FullName, $newBytes)
}

Write-Host "Updated: $relativePath"
}

if ($DryRun) {
Write-Host "Dry run: $updatedFiles file(s) would be updated to end year $Year."
}
else {
Write-Host "Updated $updatedFiles file(s) to end year $Year."
}

Write-Output $updatedFiles
Loading
Loading