Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .fantomasignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
obj/**/*.fs
src/Fantomas.FCS/generated
2 changes: 1 addition & 1 deletion .githooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ remote_url="$2"

# ensure that formatting is correct before pushing to the remote repository
dotnet tool restore
dotnet fake build -t CheckFormat
dotnet fantomas -r src docs/.style/ build.fsx
21 changes: 2 additions & 19 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@ let configuration = DotNet.BuildConfiguration.Release
let solutionFile = "fantomas.sln"
//// Environment.CurrentDirectory <- __SOURCE_DIRECTORY__

// Files to format
let sourceFiles =
!! "src/**/*.fs"
++ "src/**/*.fsi"
++ "build.fsx"
++ "docs/**/*.fsx"
-- "src/**/obj/**/*.fs"
-- "src/Fantomas.FCS/generated/netstandard2.0/*.*"

// Types and helper functions for building external projects (see the TestExternalProjects target below)
type ProcessStartInfo =
{ ProcessName: string
Expand Down Expand Up @@ -300,11 +291,7 @@ Target.create "Benchmark" (fun _ ->
)

Target.create "Format" (fun _ ->
let result =
sourceFiles
|> Seq.map (sprintf "\"%s\"")
|> String.concat " "
|> DotNet.exec id "fantomas"
let result = DotNet.exec id "fantomas" "--recurse src docs/.style/ build.fsx"

if not result.OK then
printfn "Errors while formatting all files: %A" result.Messages)
Expand All @@ -330,11 +317,7 @@ Target.create "FormatChanged" (fun _ ->

Target.create "CheckFormat" (fun _ ->
let result =
sourceFiles
|> Seq.map (sprintf "\"%s\"")
|> String.concat " "
|> sprintf "%s --check"
|> DotNet.exec id "fantomas"
DotNet.exec id "fantomas" "--check --recurse src docs/.style/ build.fsx"

if result.ExitCode = 0 then
Trace.log "No files need formatting"
Expand Down