Skip to content

Commit 1d09622

Browse files
committed
Ignore generated files in formatting checks
1 parent 1e69ee4 commit 1d09622

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

build/build.fs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -666,15 +666,26 @@ let githubRelease _ =
666666
|> GitHub.publishDraft
667667
|> Async.RunSynchronously
668668

669+
let ignoredFilePredicates = [
670+
fun (f : string) -> f.EndsWith("AssemblyInfo.fs")
671+
fun (f : string) -> f.EndsWith("Generated.fs")
672+
]
673+
674+
module Seq =
675+
let filterOut predicate xs =
676+
xs |> Seq.filter(predicate >> not)
677+
678+
let withoutIgnoredFiles =
679+
Seq.filterOut(fun f -> ignoredFilePredicates |> Seq.exists (fun p -> p f))
680+
669681
let formatCode _ =
670682
let result =
671683
[
672684
srcCodeGlob
673685
testsCodeGlob
674686
]
675687
|> Seq.collect id
676-
// Ignore AssemblyInfo
677-
|> Seq.filter(fun f -> f.EndsWith("AssemblyInfo.fs") |> not)
688+
|> withoutIgnoredFiles
678689
|> String.concat " "
679690
|> dotnet.fantomas
680691

@@ -689,8 +700,7 @@ let checkFormatCode _ =
689700
testsCodeGlob
690701
]
691702
|> Seq.collect id
692-
// Ignore AssemblyInfo
693-
|> Seq.filter(fun f -> f.EndsWith("AssemblyInfo.fs") |> not)
703+
|> withoutIgnoredFiles
694704
|> String.concat " "
695705
|> sprintf "%s --check"
696706
|> dotnet.fantomas

0 commit comments

Comments
 (0)