Skip to content

Commit

Permalink
chore(deps): bump fantomas from 6.3.16 to 7.0.0 (#637)
Browse files Browse the repository at this point in the history
* chore(deps): bump fantomas from 6.3.16 to 7.0.0

Bumps [fantomas](https://github.com/fsprojects/fantomas) from 6.3.16 to 7.0.0.
- [Release notes](https://github.com/fsprojects/fantomas/releases)
- [Changelog](https://github.com/fsprojects/fantomas/blob/main/CHANGELOG.md)
- [Commits](fsprojects/fantomas@v6.3.16...v7.0.0)

---
updated-dependencies:
- dependency-name: fantomas
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* apply fantomas to the codebase

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: 64J0 <[email protected]>
  • Loading branch information
dependabot[bot] and 64J0 authored Jan 20, 2025
1 parent 0b29c5c commit 19d3435
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"fantomas": {
"version": "6.3.16",
"version": "7.0.0",
"commands": [
"fantomas"
]
Expand Down
6 changes: 1 addition & 5 deletions samples/GlobalRateLimiting/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ let endpoints: list<Endpoint> = [ GET [ route "/" (text "Hello World") ] ]
let notFoundHandler = text "Not Found" |> RequestErrors.notFound

let configureApp (appBuilder: IApplicationBuilder) =
appBuilder
.UseRouting()
.UseRateLimiter()
.UseGiraffe(endpoints)
.UseGiraffe(notFoundHandler)
appBuilder.UseRouting().UseRateLimiter().UseGiraffe(endpoints).UseGiraffe(notFoundHandler)

let configureServices (services: IServiceCollection) =
// From https://blog.maartenballiauw.be/post/2022/09/26/aspnet-core-rate-limiting-middleware.html
Expand Down
3 changes: 2 additions & 1 deletion src/Giraffe/EndpointRouting.fs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,8 @@ type EndpointRouteBuilderExtensions() =

[<Extension>]
static member private MapSingleEndpoint
(builder: IEndpointRouteBuilder, singleEndpoint: HttpVerb * RouteTemplate * RequestDelegate * ConfigureEndpoint) =
(builder: IEndpointRouteBuilder, singleEndpoint: HttpVerb * RouteTemplate * RequestDelegate * ConfigureEndpoint)
=

let verb, routeTemplate, requestDelegate, configureEndpoint = singleEndpoint

Expand Down
5 changes: 1 addition & 4 deletions src/Giraffe/Routing.fs
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,7 @@ module Routing =
/// <returns>A Giraffe <see cref="HttpHandler"/> function which can be composed into a bigger web application.</returns>
let routeStartsWithCi (subPath: string) : HttpHandler =
fun (next: HttpFunc) (ctx: HttpContext) ->
if
(SubRouting.getNextPartOfPath ctx)
.StartsWith(subPath, StringComparison.OrdinalIgnoreCase)
then
if (SubRouting.getNextPartOfPath ctx).StartsWith(subPath, StringComparison.OrdinalIgnoreCase) then
next ctx
else
skipPipeline
Expand Down
13 changes: 3 additions & 10 deletions tests/Giraffe.Tests/Helpers.fs
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,7 @@ module XmlAssert =
.Attributes()
.Where(fun a -> a.Name.Namespace = XNamespace.Xmlns)
.OrderBy(fun a -> a.Name.ToString()),
element
.Elements()
.OrderBy(fun a -> a.Name.ToString())
.Select(fun e -> normalize (e))
element.Elements().OrderBy(fun a -> a.Name.ToString()).Select(fun e -> normalize (e))
)
elif element.IsEmpty then
XElement(element.Name, element.Attributes().OrderBy(fun a -> a.Name.ToString()))
Expand Down Expand Up @@ -104,9 +101,7 @@ let createHost

let mockJson (ctx: HttpContext) =

ctx.RequestServices
.GetService(typeof<Json.ISerializer>)
.Returns(Json.Serializer(Json.Serializer.DefaultOptions))
ctx.RequestServices.GetService(typeof<Json.ISerializer>).Returns(Json.Serializer(Json.Serializer.DefaultOptions))
|> ignore

type NegotiationConfigWithExpectedResult =
Expand All @@ -123,9 +118,7 @@ let mockXml (ctx: HttpContext) =
|> ignore

let mockNegotiation (ctx: HttpContext) (negotiationConfig: INegotiationConfig) =
ctx.RequestServices
.GetService(typeof<INegotiationConfig>)
.Returns(negotiationConfig)
ctx.RequestServices.GetService(typeof<INegotiationConfig>).Returns(negotiationConfig)
|> ignore

// ---------------------------------
Expand Down
8 changes: 2 additions & 6 deletions tests/Giraffe.Tests/HttpHandlerTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@ and JsonUnionCaseDummy =
let ``GET "/json" returns json object with fsharp type (JsonUnionCaseDummyA)`` () =
let ctx = Substitute.For<HttpContext>()

ctx.RequestServices
.GetService(typeof<Json.ISerializer>)
.Returns(Json.FsharpFriendlySerializer())
ctx.RequestServices.GetService(typeof<Json.ISerializer>).Returns(Json.FsharpFriendlySerializer())
|> ignore

let app =
Expand Down Expand Up @@ -120,9 +118,7 @@ let ``GET "/json" returns json object with fsharp type (JsonUnionCaseDummyA)`` (
let ``GET "/json" returns json object with fsharp type (JsonUnionCaseDummyB)`` () =
let ctx = Substitute.For<HttpContext>()

ctx.RequestServices
.GetService(typeof<Json.ISerializer>)
.Returns(Json.FsharpFriendlySerializer())
ctx.RequestServices.GetService(typeof<Json.ISerializer>).Returns(Json.FsharpFriendlySerializer())
|> ignore

let app =
Expand Down

0 comments on commit 19d3435

Please sign in to comment.