Skip to content

Commit 57239a8

Browse files
authored
Merge pull request #500 from Inxton/499-investigate-line-endings-in-generated-files
investigate line endings in generated files
2 parents 98e55eb + ae40da0 commit 57239a8

25 files changed

Lines changed: 218 additions & 38 deletions

File tree

.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true

.gitattributes

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Default: treat as text, normalize to LF in the repository
2+
* text=auto eol=lf
3+
4+
# Typical source files (explicit, but the default already covers these)
5+
*.c text eol=lf
6+
*.cpp text eol=lf
7+
*.h text eol=lf
8+
*.py text eol=lf
9+
*.js text eol=lf
10+
*.ts text eol=lf
11+
*.sh text eol=lf
12+
*.yaml text eol=lf
13+
*.yml text eol=lf
14+
*.json text eol=lf
15+
*.css text eol=lf
16+
*.cs text eol=lf
17+
18+
19+
# Windows-native scripts that often *must* be CRLF in the working tree
20+
# (repo still stores LF; checkout converts to CRLF)
21+
*.bat text eol=crlf
22+
*.cmd text eol=crlf
23+
*.ps1 text eol=lf
24+
25+
# Binary files (never touch line endings)
26+
*.png -text
27+
*.jpg -text
28+
*.zip -text
29+
*.pdf -text

src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Helpers/CsFormatting.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ internal static class CsFormatting
1414
{
1515
public static string FormatCode(this string code)
1616
{
17-
return CSharpSyntaxTree.ParseText(code).GetRoot().NormalizeWhitespace().SyntaxTree.GetText().ToString();
17+
return CSharpSyntaxTree.ParseText(code).GetRoot().NormalizeWhitespace(eol:"\n").SyntaxTree.GetText().ToString();
1818
}
1919
}

src/AXSharp.compiler/src/ixc/Properties/launchSettings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@
6969
"axopen-traversal-in-tepmplates": {
7070
"commandName": "Project",
7171
"workingDirectory": "C:\\W\\Develop\\gh\\inxton\\simatic-ax\\axopen.templates\\axopen\\src\\traversals\\apax"
72+
},
73+
"ixc_data": {
74+
"commandName": "Project",
75+
"workingDirectory": "D:\\github\\Inxton\\axopen\\src\\data\\tests\\AXOpen.Data.Tests_L1\\ax"
7276
}
7377
}
7478
}

src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/Cs/CsSourceBuilderTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// AXSharp.Compiler.CsTests
1+
// AXSharp.Compiler.CsTests
22
// Copyright (c) 2023 MTS spol. s r.o., and Contributors. All Rights Reserved.
33
// Contributors: https://github.com/inxton/axsharp/graphs/contributors
44
// See the LICENSE file in the repository root for more information.
@@ -352,4 +352,4 @@ public string GetMethodName()
352352
var name = method.Name;
353353
return name;
354354
}
355-
}
355+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"OutputProjectFolder":"ix","UseBase":false,"NoDependencyUpdate":false,"IgnoreS7Pragmas":false,"SkipDependencyCompilation":false,"ProjectFile":"app.csproj"}
1+
{"OutputProjectFolder":"ix","UseBase":false,"NoDependencyUpdate":false,"IgnoreS7Pragmas":false,"SkipDependencyCompilation":false,"TargetPlatfromMoniker":"ax","ProjectFile":"app.csproj"}

src/AXSharp.compiler/tests/integration/expected/app/ix/.meta/meta.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/AXSharp.compiler/tests/integration/expected/app/ix/.meta/sourceinfo.json

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFrameworks>net10.0</TargetFrameworks>
4+
<ImplicitUsings>enable</ImplicitUsings>
5+
<Nullable>enable</Nullable>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<PackageReference Include="AXSharp.Abstractions" Version="0.22.0-330-new-feature-poco-property-of-datetime-has-different-default-value-than-plc.299" />
10+
<PackageReference Include="AXSharp.Connector" Version="0.22.0-330-new-feature-poco-property-of-datetime-has-different-default-value-than-plc.299" />
11+
</ItemGroup>
12+
13+
<ItemGroup>
14+
<Compile Include=".g\**" />
15+
</ItemGroup>
16+
17+
<ItemGroup>
18+
<Folder Include=".meta\" />
19+
<Content Include=".meta\**" />
20+
</ItemGroup>
21+
22+
<ItemGroup>
23+
<ProjectReference Include="..\..\..\..\..\lib1\samples\units\ix\ax\lib1.csproj" />
24+
<ProjectReference Include="..\..\..\..\..\lib2\samples\units\ix\ax\lib2.csproj" />
25+
</ItemGroup>
26+
</Project>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFrameworks>net10.0</TargetFrameworks>
4+
<ImplicitUsings>enable</ImplicitUsings>
5+
<Nullable>enable</Nullable>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<PackageReference Include="AXSharp.Abstractions" Version="0.22.0-330-new-feature-poco-property-of-datetime-has-different-default-value-than-plc.299" />
10+
<PackageReference Include="AXSharp.Connector" Version="0.22.0-330-new-feature-poco-property-of-datetime-has-different-default-value-than-plc.299" />
11+
</ItemGroup>
12+
13+
<ItemGroup>
14+
<Compile Include=".g\**" />
15+
</ItemGroup>
16+
17+
<ItemGroup>
18+
<Folder Include=".meta\" />
19+
<Content Include=".meta\**" />
20+
</ItemGroup>
21+
22+
<ItemGroup>
23+
<ProjectReference Include="..\..\..\..\..\lib1\samples\units\ix\tia\lib1.csproj" />
24+
<ProjectReference Include="..\..\..\..\..\lib2\samples\units\ix\tia\lib2.csproj" />
25+
</ItemGroup>
26+
</Project>

0 commit comments

Comments
 (0)