Comments (11)
GettingStarted.html
was out of date indeed, I raised #2857
from fantomas.
Hello,
Upgrading from version 4.7.9 to 6.0.1 entails two major version bumps, which may introduce breaking changes. Please be aware of this when making the update.
It's worth noting that if you pass a non-existent folder when multiple folders are being passed, the folder will be created as expected.
Mixing versions in your setup seems rather specific on how you choose to do things. You can detect the current version using dotnet fantomas --version
and adjust your build script accordingly.
from fantomas.
OK, so I was fooled by official documentation at https://fsprojects.github.io/fantomas/docs/end-users/GettingStarted.html
USAGE: dotnet fantomas [--help] [--recurse] [--force] [--profile] [--fsi ] [--stdin] [--stdout] [--out ] [--check] [--daemon] [--version] []
showing the --recurse
is a valid flag. I can see the tool does not show it anymore.
On the other side, I must admit this is very strange to identify the --recurse
configuration flag as a directory name (even if it is not a valid flag) and also it is very strange to default to create any non-existing file or directory as a new directory.
Thanks for looking into my case!
from fantomas.
P.S.
It was tricky to remove that directory:
witoldsz@678db1ca1a61:/app/modules/event-logger2$ rmdir --recurse
rmdir: unrecognized option '--recurse'
Try 'rmdir --help' for more information.
witoldsz@678db1ca1a61:/app/modules/event-logger2$ rmdir -- --recurse
It is expected to treat any --something
as a flag. Maybe fantomas
could follow the rule?
from fantomas.
For whomever it may be useful, my Makefile
script works this around like this:
# TODO: upgrade fantomas everywhere and remove this workaround
FANTOMAS = dotnet fantomas `dotnet fantomas --version |grep -q v4.7 && echo --recurse`
check-format: tool-restore
$(FANTOMAS) --check .
format: tool-restore
$(FANTOMAS) .
[...]
from fantomas.
Hello, I often makes mistakes when invoking fantomas and because of that it creates empty directories.
It's worth noting that if you pass a non-existent folder when multiple folders are being passed, the folder will be created as expected.
Why is the expected behaviour to create an empty directory?
If I provide a single non existing directory then it reports it as missing which helps diagnostic the problem.
To me it feels strange to me that a formatting tool create additional files and not just consume only existing files.
from fantomas.
You could format a directory and output it into a different directory.
If that destination directory does not exist we create it.
Because the source and destination are the same that happens.
from fantomas.
Sorry, I don't understand do you have a command example?
Looking at the help message:
USAGE: dotnet fantomas [--help] [--force] [--profile] [--out <string>] [--check] [--daemon] [--version] [--verbosity <string>] [<string>...]
INPUT:
<string>... Input paths: can be multiple folders or files with *.fs,*.fsi,*.fsx,*.ml,*.mli extension.
OPTIONS:
--force Print the output even if it is not valid F# code. For debugging purposes only.
--profile Print performance profiling information.
--out <string> Give a valid path for files/folders. Files should have .fs, .fsx, .fsi, .ml or .mli extension only. Multiple files/folders are not supported.
--check Don't format files, just check if they have changed. Exits with 0 if it's formatted correctly, with 1 if some files need formatting and 99 if there was an
internal error
--daemon Daemon mode, launches an LSP-like server to can be used by editor tooling.
--version Displays the version of Fantomas
--verbosity, -v <string>
Set the verbosity level. Allowed values are n[ormal] and d[etailed].
--help display this list of options.
It seems that if I do dotnet fantomas dir1 dir2
then both dir1 dir2
refers to <string>...
which is the input paths
arguments.
I also tried to use the --out
option as I was thinking this is what you are referring to when speaking of a different directory but I was not able to make it works.
dotnet fantomas src --out fantomas
fails with
➜ Glutinum.Converter git:(main) ✗ dotnet fantomas --out fantomas src
Formatted │ 0 │ Ignored │ 0 │ Unchanged │ 0 │ Errored │ 30
Failed to format file: src/Glutinum.Converter/Utils/Keywords.fs
Failed to format file: src/Glutinum.Converter/Utils/Naming.fs
Failed to format file: src/Glutinum.Converter/Utils/String.fs
Failed to format file: src/Glutinum.Converter/Reader/TypeParameters.fs
Failed to format file: src/Glutinum.Converter/Reader/ClassDeclaration.fs
Failed to format file: src/Glutinum.Converter/Reader/Types.fs
Failed to format file: src/Glutinum.Converter/Reader/ModuleDeclaration.fs
Failed to format file: src/Glutinum.Converter/Reader/TypeNode.fs
Failed to format file: src/Glutinum.Converter/Reader/FunctionDeclaration.fs
...
Even if dotnet fantomas src
works.
from fantomas.
I really don't quite remember how it works. This seems to somewhat works for me: dotnet fantomas .\Style\ --out Foobar
. Folder Foobar
was created and contains the formatted files.
However there is something weird with the output file name.
from fantomas.
See 3024 for a possible fix.
from fantomas.
I really don't quite remember how it works. This seems to somewhat works for me:
dotnet fantomas .\Style\ --out Foobar
. FolderFoobar
was created and contains the formatted files.
However there is something weird with the output file name.
Ok perhaps, there is something strange in my project
from fantomas.
Related Issues (20)
- Invalid F# code after formatting HOT 1
- Formatting removes necessary additional closing brackets for multiline interpolated strings HOT 1
- Fantomas reports an error when formatting interpolated string with tripple quotes HOT 7
- Idempotency problem when _.Property shorthand
- Regression: Stroustrup bracket style in anonymous record type parameter is not respected
- HashDirective before closing `]`
- Long parameter attribute gives weird line break before type annotation
- Fantomas corrupts an explicit constructor with `then` clause HOT 2
- FormatASTAsync loses single quotes for characters HOT 4
- Regression: An empty line or comment at the end of a list breaks Stroustrup formatting HOT 2
- `SpaceBeforeUppercaseInvocation` corrupts underscore lambda invocation HOT 1
- Non needed parentheses are added around lambda call from tuple/members HOT 3
- [Feature request] Make newline experience consistent across match branches HOT 1
- Make Fantomas AOT compatible HOT 12
- cannot determine if Expr AppSingleParenArg Fantomas.Core.SyntaxOak+ExprAppSingleParenArgNode is uppercase or lowercase HOT 1
- cannot determine if Expr AppSingleParenArg Fantomas.Core.SyntaxOak+ExprAppSingleParenArgNode is uppercase or lowercase HOT 2
- [Feature request] Keep `interface end` on a single line HOT 1
- Regression since 6.3.5: Shorthand lambda pushes args far out right with name-sensitive alignment; discrepancy with normal lambda HOT 1
- Stroustrup formatting breaks array containing just empty line or comment HOT 1
- [Feature request] Set custom fantomas path on Fantomas.Client HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fantomas.