You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ tree
.
├── Code.Dir
│ └── Program.fs
└── fantomas-config.json
This works correctly and applies settings from fantomas-config.json:
$ fantomas --config Code.Dir/ Code.Dir/Program.fs
Code.Dir/Program.fs has been written.
This reports an error and ignores fantomas-config.json:
$ fantomas --config Code.Dir Code.Dir/Program.fs
Couldn't process one or more Fantomas configuration files, falling back to the default configuration
System.Exception: No configuration files were found for Code.Dir
at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1637.Invoke(String message) in E:\A\_work\130\s\src\fsharp\FSharp.Core\printf.fs:line 1637
at Fantomas.CodeFormatterImpl.readConfiguration(String fileOrFolder) in C:\Users\nojaf\Projects\fantomas\src\Fantomas\CodeFormatterImpl.fs:line 679
Code.Dir/Program.fs has been written.
Note the lack of a trailing / on Code.Dir in the second example. I've reproduced this behavior on both Linux and Windows 10.
if Path.GetExtension(fileOrFolder)=""&& Directory.Exists fileOrFolder then
Microsoft (R) F# Interactive version 10.7.0.0 for F# 4.7
Copyright (c) Microsoft Corporation. All Rights Reserved.
For help type #help;;
> open System.IO;;
> Path.GetExtension("Code.Dir/");;
val it : string = ""
> Path.GetExtension("Code.Dir");;
val it : string = ".Dir"
The text was updated successfully, but these errors were encountered:
Hey @tcallan, thanks for reporting this problem.
I know this is probably not the answer your looking for but would you be up for it to fix this yourself in a PR 😅?
There are not that many active contributors and you don't really need a lot of knowledge of the internals of Fantomas to solve this.
Given a project structure like the following:
This works correctly and applies settings from fantomas-config.json:
This reports an error and ignores fantomas-config.json:
Note the lack of a trailing
/
onCode.Dir
in the second example. I've reproduced this behavior on both Linux and Windows 10.I believe the problem is the following line:
fantomas/src/Fantomas/ConfigFile.fs
Line 26 in 3d2e39e
The text was updated successfully, but these errors were encountered: