Closed zakaluka closed 5 years ago
Hi, I did an attempt to reproduce this in https://github.com/fsprojects/fantomas/pull/434/commits/097bbcaab733bef8e147c4caf4f4072d338c0fcb. I don't think this is an issue anymore. What version of fantomas are you here?
Please reopen if the problem still occurs with the latest beta.
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