-
Notifications
You must be signed in to change notification settings - Fork 368
Fold F# .fsproj ordering into msbuild-antipatterns AP-05 #577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
0f3d7b3
Add fsharp-project-structure skill for .fsproj file ordering and .fsi…
T-Gro 194579d
Add fsharp-project-structure skill for .fsproj file ordering and .fsi…
T-Gro ddfcf42
Merge branch 'feature/fsharp-projects-mgmt' of https://github.com/T-G…
T-Gro da175b1
Update plugins/dotnet/skills/fsharp-project-structure/SKILL.md
T-Gro 51b2ce3
Merge remote-tracking branch 'origin/main' into feature/fsharp-projec…
T-Gro 6992adc
Fold F# project-structure into msbuild-antipatterns AP-05
T-Gro 8354851
Merge remote-tracking branch 'upstream/main' into feature/fsharp-proj…
T-Gro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
11 changes: 11 additions & 0 deletions
11
tests/dotnet-msbuild/msbuild-antipatterns/fsharp/BrokenOrder/BrokenOrder.fsproj
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
| <PropertyGroup> | ||
| <OutputType>Exe</OutputType> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| </PropertyGroup> | ||
| <ItemGroup> | ||
| <Compile Include="Services.fs" /> | ||
| <Compile Include="Domain.fs" /> | ||
| <Compile Include="Program.fs" /> | ||
| </ItemGroup> | ||
| </Project> |
15 changes: 15 additions & 0 deletions
15
tests/dotnet-msbuild/msbuild-antipatterns/fsharp/BrokenOrder/Domain.fs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| module BrokenOrder.Domain | ||
|
|
||
| type OrderId = OrderId of int | ||
|
|
||
| type OrderItem = { | ||
| Name: string | ||
| Quantity: int | ||
| Price: decimal | ||
| } | ||
|
|
||
| type Order = { | ||
| Id: OrderId | ||
| CustomerName: string | ||
| Items: OrderItem list | ||
| } |
14 changes: 14 additions & 0 deletions
14
tests/dotnet-msbuild/msbuild-antipatterns/fsharp/BrokenOrder/Program.fs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| open BrokenOrder.Domain | ||
| open BrokenOrder.Services | ||
|
|
||
| let order = { | ||
| Id = OrderId 1 | ||
| CustomerName = "Alice" | ||
| Items = [ | ||
| { Name = "Widget"; Quantity = 2; Price = 9.99m } | ||
| { Name = "Gadget"; Quantity = 1; Price = 24.99m } | ||
| ] | ||
| } | ||
|
|
||
| let total = processOrder order | ||
| printfn "Order total: $%M" total |
12 changes: 12 additions & 0 deletions
12
tests/dotnet-msbuild/msbuild-antipatterns/fsharp/BrokenOrder/Services.fs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| module BrokenOrder.Services | ||
|
|
||
| open BrokenOrder.Domain | ||
|
|
||
| let calculateTotal (order: Order) = | ||
| order.Items | ||
| |> List.sumBy (fun item -> item.Price * decimal item.Quantity) | ||
|
|
||
| let processOrder (order: Order) = | ||
| let total = calculateTotal order | ||
| printfn "Processing order for %s: $%M" order.CustomerName total | ||
| total |
6 changes: 6 additions & 0 deletions
6
tests/dotnet-msbuild/msbuild-antipatterns/fsharp/Directory.Build.props
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <Project> | ||
| <!-- Empty: intentionally short-circuits the parent Directory.Build.props | ||
| which exists only as a C# antipattern fixture and would otherwise | ||
| leak C#-specific settings (analyzers, TreatWarningsAsErrors) into | ||
| these F# fixtures. --> | ||
| </Project> |
3 changes: 3 additions & 0 deletions
3
tests/dotnet-msbuild/msbuild-antipatterns/fsharp/Directory.Build.targets
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| <Project> | ||
| <!-- Empty: see Directory.Build.props in this folder for rationale. --> | ||
| </Project> |
15 changes: 15 additions & 0 deletions
15
tests/dotnet-msbuild/msbuild-antipatterns/fsharp/OrderService/Domain.fs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| module OrderService.Domain | ||
|
|
||
| type OrderId = OrderId of int | ||
|
|
||
| type OrderItem = { | ||
| Name: string | ||
| Quantity: int | ||
| Price: decimal | ||
| } | ||
|
|
||
| type Order = { | ||
| Id: OrderId | ||
| CustomerName: string | ||
| Items: OrderItem list | ||
| } |
11 changes: 11 additions & 0 deletions
11
tests/dotnet-msbuild/msbuild-antipatterns/fsharp/OrderService/OrderService.fsproj
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
| <PropertyGroup> | ||
| <OutputType>Exe</OutputType> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| </PropertyGroup> | ||
| <ItemGroup> | ||
| <Compile Include="Domain.fs" /> | ||
| <Compile Include="Services.fs" /> | ||
| <Compile Include="Program.fs" /> | ||
| </ItemGroup> | ||
| </Project> |
14 changes: 14 additions & 0 deletions
14
tests/dotnet-msbuild/msbuild-antipatterns/fsharp/OrderService/Program.fs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| open OrderService.Domain | ||
| open OrderService.Services | ||
|
|
||
| let order = { | ||
| Id = OrderId 1 | ||
| CustomerName = "Alice" | ||
| Items = [ | ||
| { Name = "Widget"; Quantity = 2; Price = 9.99m } | ||
| { Name = "Gadget"; Quantity = 1; Price = 24.99m } | ||
| ] | ||
| } | ||
|
|
||
| let total = processOrder order | ||
| printfn "Order total: $%M" total |
12 changes: 12 additions & 0 deletions
12
tests/dotnet-msbuild/msbuild-antipatterns/fsharp/OrderService/Services.fs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| module OrderService.Services | ||
|
|
||
| open OrderService.Domain | ||
|
|
||
| let calculateTotal (order: Order) = | ||
| order.Items | ||
| |> List.sumBy (fun item -> item.Price * decimal item.Quantity) | ||
|
|
||
| let processOrder (order: Order) = | ||
| let total = calculateTotal order | ||
| printfn "Processing order for %s: $%M" order.CustomerName total | ||
| total |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.