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
Fantomas removes the module and namespace lines if they are the first line in the file AND they don't contain any dots.
However, if the module or namespace contains dots (e.g. Shared.Utility), the line is not removed.
This happens when using formatCode in a FAKE build.fsx file.
Options:
// Common Fantomas Config to reformat files and check that formatting compliesletfantomasConfig={ FormatConfig.Default with
StrictMode =true
IndentSpaceNum =2
SpaceBeforeColon =false}
Repro code
Incorrect
Input:
namespaceSharedtypeCounter= int
Output:
typeCounter= int
Expected:
namespaceSharedtypeCounter= int
But this works okay
Input:
moduleZenCase.Shared.Utility/// Allows debugging output without breaking function chainslettee f x = f x |> ignore; x
Output:
moduleZenCase.Shared.Utility/// Allows debugging output without breaking function chainslettee f x =
f x |> ignore
x
The text was updated successfully, but these errors were encountered:
zakaluka
changed the title
Fantomas removes module and namespace if it is only 1 work (without dots)
Fantomas removes module and namespace if it is only 1 word (without dots)
Dec 8, 2018
Description
Fantomas removes the
module
andnamespace
lines if they are the first line in the file AND they don't contain any dots.However, if the
module
ornamespace
contains dots (e.g.Shared.Utility
), the line is not removed.This happens when using
formatCode
in a FAKEbuild.fsx
file.Options:
Repro code
Incorrect
Input:
Output:
Expected:
But this works okay
Input:
Output:
http://ratatosk.dynu.net/fantomas/#?code=HYQwtgpgzgDiDGEAEBlAFiAThAJgWAChCAXATxmQGEB7AV2GIkyQF4kBLBwwoA&config=N4IgkgdgJgphAuBlADgQwMYwHIFcC2IAXACwA0IACqgOYwDqAllPABZEAcADORQE4wBnGLwBuMAKLQA8gDMAMgwgwiM1ABsh5RDDwN0AezX6IAQXiSoshUpXrNIFBhgAhGDP38Tvavjjwi8Lw4MFpomK7u-ADChsYBQSEOYTAmMvDCMXh4qPHBoU6p6bzaugZGELmJkLAIUhAAKrwAnoysthqJAEowHrC8UshwACIw6GqovKjwDHGEqh35mF76ONAjagy6RZVagXrwALL6sO1CAL5AA
NOTE: This work correctly online, but not when part of the FAKE pipeline.
EDIT: Matched config with the options from
build.fsx
. Despite that, it will works correctly online.http://ratatosk.dynu.net/fantomas/#?code=HYQwtgpgzgDiDGEAEBlAFiAThAJgWAChCAXATxmQGEB7AV2GIkyQF4kBLBwwoA&config=N4IgkgdgJgphAuBlADgQwMYwHIFcC2IAXAEwA0IACqgOYwDqAllPABZEAcADORQE4wBnGLwBuMAKLQA8gDMAMgwgwiM1ABsh5RDDwN0AezX6IAQXiSoshUpXrNIFBhgAhGDP38Tvavjjwi8Lw4MFpomK7u-ADChsa2GiEOYTAmMvDCMXh4qAFBiY6Yqem82roGRhC5weSQsAhSEAAqvACejKzx9gBKMB6wvFLIcAAiMOhqqLyo8AxxhKoJoU5e+jjQo2oMusVV+YF68ACy+rC7AL5AA
The text was updated successfully, but these errors were encountered: