Skip to content

Commit 76fd8ff

Browse files
committed
Change formatting rules
1 parent 4db3965 commit 76fd8ff

14 files changed

+21
-37
lines changed

.config/dotnet-tools.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
]
1010
},
1111
"fantomas": {
12-
"version": "6.3.0-alpha-005",
12+
"version": "6.3.0-alpha-007",
1313
"commands": [
1414
"fantomas"
1515
]

.editorconfig

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ trim_trailing_whitespace = true
1111
max_line_length = 80
1212
fsharp_alternative_long_member_definitions = true
1313
fsharp_multi_line_lambda_closing_newline = true
14-
fsharp_bar_before_discriminated_union_declaration = true
1514
fsharp_multiline_bracket_style = aligned
16-
fsharp_keep_max_number_of_blank_lines = 2
15+
fsharp_keep_max_number_of_blank_lines = 1
1716
fsharp_record_multiline_formatter = number_of_items
1817
fsharp_max_record_number_of_items = 1
1918
fsharp_array_or_list_multiline_formatter = number_of_items

.husky/task-runner.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
"include": [
1212
"src/**/*.fs",
1313
"src/**/*.fsx",
14-
"src/**/*.fsi"
14+
"src/**/*.fsi",
15+
"test/**/*.fs",
16+
"test/**/*.fsx",
17+
"test/**/*.fsi"
1518
]
1619
},
1720
{

src/Glutinum.Build/Main.fs

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ let main argv =
6060
match argv with
6161
| "test" :: args -> Test.Specs.handle args
6262
| "publish" :: args -> Publish.handle args
63-
| "lint" :: _ -> Command.Run("dotnet", "fantomas --check src")
64-
| "format" :: _ -> Command.Run("dotnet", "fantomas src")
63+
| "lint" :: _ -> Command.Run("dotnet", "fantomas --check src tests")
64+
| "format" :: _ -> Command.Run("dotnet", "fantomas src tests")
6565
| "cli" :: args -> Cli.handle args
6666
| "help" :: _
6767
| "--help" :: _

src/Glutinum.Build/Publish.fs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ open BlackFox.CommandLine
77
open Build.Utils
88
open Build.Utils.Pnpm
99

10-
1110
let private publishNpm (projectDir: string) =
1211
let packageJsonPath = Path.Combine(projectDir, "package.json")
1312
let packageJsonContent = File.ReadAllText(packageJsonPath)

src/Glutinum.Build/Utils/ChangelogParser.fs

-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ module Types =
6767
| SubSubSection of tag: string
6868
| ListItem of content: string
6969

70-
7170
[<RequireQualifiedAccess>]
7271
module Lexer =
7372

src/Glutinum.Build/Utils/Nuget.fs

+1-5
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@ open BlackFox.CommandLine
77
type Nuget =
88

99
static member push
10-
(
11-
nupkgPath: string,
12-
nugetKey: string,
13-
?skipDuplicate: bool
14-
)
10+
(nupkgPath: string, nugetKey: string, ?skipDuplicate: bool)
1511
=
1612
let skipDuplicate = defaultArg skipDuplicate false
1713

src/Glutinum.Build/Utils/Pnpm.fs

+1-5
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@ type Pnpm =
2121
static member install() = Command.Run("pnpm", "install")
2222

2323
static member publish
24-
(
25-
?projectDir: string,
26-
?noGitChecks: bool,
27-
?access: Publish.Access
28-
)
24+
(?projectDir: string, ?noGitChecks: bool, ?access: Publish.Access)
2925
=
3026
let noGitChecks = defaultArg noGitChecks false
3127

src/Glutinum.Converter/GlueAST.fs

+3-3
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ type GlueModuleDeclaration =
150150
Types: GlueType list
151151
}
152152

153-
type GlueConstructor = | GlueConstructor of GlueParameter list
153+
type GlueConstructor = GlueConstructor of GlueParameter list
154154

155155
type GlueClassDeclaration =
156156
{
@@ -167,10 +167,10 @@ type GlueTypeReference =
167167
TypeArguments: GlueType list
168168
}
169169

170-
type GlueTypeUnion = | GlueTypeUnion of GlueType list
170+
type GlueTypeUnion = GlueTypeUnion of GlueType list
171171

172172
[<RequireQualifiedAccess>]
173-
type ExcludedMember = | Literal of GlueLiteral
173+
type ExcludedMember = Literal of GlueLiteral
174174
// | Function
175175

176176
type GlueFunctionType =

src/Glutinum.Converter/Reader/TypeAliasDeclaration.fs

-2
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,8 @@ let readTypeAliasDeclaration
2525
let declaration = declaration.``type`` :?> Ts.IndexedAccessType
2626
reader.ReadIndexedAccessType declaration
2727

28-
2928
| _ -> reader.ReadTypeNode declaration.``type``
3029

31-
3230
{
3331
Name = declaration.name.getText ()
3432
Type = typ

src/Glutinum.Converter/Reader/UnionTypeNode.fs

-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ let rec private readUnionTypeCases
114114
typeReferenceNode
115115
)
116116

117-
118117
// else
119118
// symbol.declarations
120119
// |> Seq.toList

src/Glutinum.Converter/Transform.fs

-1
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,6 @@ let private transformTypeParameters
472472
}
473473
)
474474

475-
476475
let private transformTypeAliasDeclaration
477476
(glueTypeAliasDeclaration: GlueTypeAliasDeclaration)
478477
: FSharpType

tests/Specs.fs

+7-4
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,24 @@ let macroTestSpec (t: ExecutionContext<obj>) (specPath: string) =
3030
promise {
3131
let filepath = $"{__SOURCE_DIRECTORY__}/specs/{specPath}.d.ts"
3232
let res = generateBindingFile filepath
33-
let res = res + """
33+
34+
let res =
35+
res
36+
+ """
3437
(***)
3538
#r "nuget: Fable.Core"
3639
(***)
3740
"""
3841

3942
let expectedFile = $"{__SOURCE_DIRECTORY__}/specs/{specPath}.fsx"
4043

41-
if fs.existsSync(!!expectedFile) then
44+
if fs.existsSync (!!expectedFile) then
4245
let! expectedContent = Fs.readFile expectedFile
43-
let expected = expectedContent
46+
let expected = expectedContent
4447
t.deepEqual.Invoke(res, expected) |> ignore
4548
else
4649
let tmpFile = $"{__SOURCE_DIRECTORY__}/specs/{specPath}.tmp.fsx"
47-
fs.writeFileSync(tmpFile, res)
50+
fs.writeFileSync (tmpFile, res)
4851
}
4952

5053
[<ImportDefault("ava")>]

tests/glues/Ava.fs

+1-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ module Glutinum.Ava
33
open Fable.Core
44
open System
55

6-
76
[<AllowNullLiteral>]
87
type LogFn =
98
/// Log one or more values.
@@ -25,7 +24,6 @@ type PlanFn =
2524
/// Don't plan assertions.
2625
abstract skip: count: float -> unit
2726

28-
2927
[<AllowNullLiteral>]
3028
type AssertAssertion =
3129
/// <summary>
@@ -38,7 +36,6 @@ type AssertAssertion =
3836
/// Skip this assertion.
3937
abstract skip: actual: obj option * ?message: string -> unit
4038

41-
4239
[<AllowNullLiteral>]
4340
type DeepEqualAssertion =
4441
/// <summary>
@@ -80,7 +77,6 @@ type ExecutionContext<'Context> =
8077
abstract log: LogFn
8178
abstract plan: PlanFn
8279

83-
8480
[<Erase>]
8581
type test<'Context> =
8682

@@ -90,9 +86,6 @@ type test<'Context> =
9086

9187
[<ImportDefault("ava")>]
9288
static member test
93-
(
94-
title: string,
95-
t: ExecutionContext<'Context> -> JS.Promise<unit>
96-
)
89+
(title: string, t: ExecutionContext<'Context> -> JS.Promise<unit>)
9790
=
9891
nativeOnly

0 commit comments

Comments
 (0)