Skip to content

Commit c1fbbf0

Browse files
CopilotHappypig375
andauthored
Enforce that line endings are always stored as LF in git tree (verybadcat#250)
* Initial plan * Add .gitattributes to fix cross-platform formatting Normalizes line endings to LF in repository while allowing platform-native checkouts (CRLF on Windows, LF on Linux). Verified that dotnet format passes on both platforms without requiring end_of_line in .editorconfig. Co-authored-by: Happypig375 <19922066+Happypig375@users.noreply.github.com> * Enforce automatic CRLF to LF conversion * Update workflows while we're at it * Fix Release workflow --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Happypig375 <19922066+Happypig375@users.noreply.github.com> Co-authored-by: Hadrian Tang <hadrianwttang@outlook.com>
1 parent 0c7e2aa commit c1fbbf0

File tree

22 files changed

+1524
-1525
lines changed

22 files changed

+1524
-1525
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.github/workflows/Nightly.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ jobs:
77
runs-on: windows-latest
88
permissions:
99
contents: write
10+
packages: write
1011
steps:
1112
- name: Update draft on GitHub Releases
1213
id: release_drafter

.github/workflows/Release.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,19 @@ jobs:
1313
- uses: actions/setup-dotnet@main
1414
with:
1515
dotnet-version: '10.x'
16-
workloads: maui-ios, maui-maccatalyst, maui-android, wasm-tools
16+
workloads: maui, wasm-tools
1717
- name: Build GitHub Releases draft artifacts
1818
env:
1919
RELEASE_NOTES: |
20-
# ${{ github.event.release.name }}
20+
${{ format('# {0}', github.event.release.name) }}
2121
2222
${{ github.event.release.body }}
2323
run: |
2424
# .NET Core MSBuild cannot parse , and ; correctly so we replace them with MSBuild XML escapes: https://github.com/dotnet/msbuild/issues/471#issuecomment-366268743
2525
$env:RELEASE_NOTES = $env:RELEASE_NOTES -replace ',','%2C' -replace ';','%3B'
2626
27-
dotnet build -c Release -p:PackageReleaseNotes="$env:RELEASE_NOTES" -p:PackageVersion="${{ github.event.release.tag_name }}"
27+
# For why Not.Uno.Example is used, see Nightly.yml
28+
dotnet build -c Not.Uno.Example -p:PackageReleaseNotes="$env:RELEASE_NOTES" -p:PackageVersion="${{ github.event.release.tag_name }}"
2829
shell: pwsh
2930
- name: Upload to GitHub Releases
3031
uses: svenstaro/upload-release-action@v2

.github/workflows/Test.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,9 @@ jobs:
1717
# Check required Xcode version for latest "dotnet workload restore": https://github.com/dotnet/macios/releases
1818
xcode-version: '26.2' # If this is to be changed, also check macos-version in matrix.os above
1919
- uses: actions/setup-dotnet@main
20-
if: matrix.os != 'ubuntu-latest'
2120
with:
2221
dotnet-version: '10.x'
23-
workloads: maui, wasm-tools
24-
- uses: actions/setup-dotnet@main
25-
if: matrix.os == 'ubuntu-latest'
26-
with:
27-
dotnet-version: '10.x'
28-
workloads: maui-android, wasm-tools
22+
workloads: ${{ case(startsWith(matrix.os, 'ubuntu'), 'maui-android, wasm-tools', 'maui, wasm-tools') }}
2923
- uses: actions/checkout@v6
3024
with:
3125
submodules: 'recursive'
Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
using Avalonia;
2-
using Avalonia.Controls;
3-
using Avalonia.Markup.Xaml;
4-
using Avalonia.Styling;
5-
6-
namespace CSharpMath.Avalonia.Example {
7-
public class MainView : UserControl {
8-
public MainView() {
9-
InitializeComponent();
10-
11-
var light = this.Find<RadioButton>("lightThemeRbn")!;
12-
var dark = this.Find<RadioButton>("darkThemeRbn")!;
13-
if ((string)Application.Current!.ActualThemeVariant.Key == "Dark")
14-
dark.IsChecked = true;
15-
else light.IsChecked = true;
16-
light.IsCheckedChanged += (sender, e) => {
17-
Application.Current!.RequestedThemeVariant =
18-
light.IsChecked == true ? ThemeVariant.Light : ThemeVariant.Dark;
19-
};
20-
dark.IsCheckedChanged += (sender, e) => {
21-
Application.Current!.RequestedThemeVariant =
22-
dark.IsChecked == false ? ThemeVariant.Light : ThemeVariant.Dark;
23-
};
24-
}
25-
26-
private void InitializeComponent() {
27-
AvaloniaXamlLoader.Load(this);
28-
}
29-
}
1+
using Avalonia;
2+
using Avalonia.Controls;
3+
using Avalonia.Markup.Xaml;
4+
using Avalonia.Styling;
5+
6+
namespace CSharpMath.Avalonia.Example {
7+
public class MainView : UserControl {
8+
public MainView() {
9+
InitializeComponent();
10+
11+
var light = this.Find<RadioButton>("lightThemeRbn")!;
12+
var dark = this.Find<RadioButton>("darkThemeRbn")!;
13+
if ((string)Application.Current!.ActualThemeVariant.Key == "Dark")
14+
dark.IsChecked = true;
15+
else light.IsChecked = true;
16+
light.IsCheckedChanged += (sender, e) => {
17+
Application.Current!.RequestedThemeVariant =
18+
light.IsChecked == true ? ThemeVariant.Light : ThemeVariant.Dark;
19+
};
20+
dark.IsCheckedChanged += (sender, e) => {
21+
Application.Current!.RequestedThemeVariant =
22+
dark.IsChecked == false ? ThemeVariant.Light : ThemeVariant.Dark;
23+
};
24+
}
25+
26+
private void InitializeComponent() {
27+
AvaloniaXamlLoader.Load(this);
28+
}
29+
}
3030
}
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup>
3-
<!--The Xunit auto-generated namespace should not overwrite CSharpMath.Evaluation-->
4-
<RootNamespace>CSharpMath.EvaluationTests</RootNamespace>
5-
</PropertyGroup>
6-
<ItemGroup>
7-
<ProjectReference Include="../CSharpMath.Evaluation/CSharpMath.Evaluation.csproj" />
8-
</ItemGroup>
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<!--The Xunit auto-generated namespace should not overwrite CSharpMath.Evaluation-->
4+
<RootNamespace>CSharpMath.EvaluationTests</RootNamespace>
5+
</PropertyGroup>
6+
<ItemGroup>
7+
<ProjectReference Include="../CSharpMath.Evaluation/CSharpMath.Evaluation.csproj" />
8+
</ItemGroup>
99
</Project>

0 commit comments

Comments
 (0)