Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reordering comments on modules #2141

Closed
1 of 3 tasks
cgravill opened this issue Mar 11, 2022 · 8 comments · Fixed by #2142
Closed
1 of 3 tasks

Reordering comments on modules #2141

cgravill opened this issue Mar 11, 2022 · 8 comments · Fixed by #2142

Comments

@cgravill
Copy link
Member

cgravill commented Mar 11, 2022

Issue created from fantomas-online

Code

// Boring copyright notice

(* Some other preamble *)

/// This module is amazing it's full of helpful lookup queries
module Queries

Result

/// This module is amazing it's full of helpful lookup queries
// Boring copyright notice

(* Some other preamble *)

module Queries

Problem description

It's not exactly an issue but it's a change between Fantomas 4.6.0 and 4.7.1 - I can narrow down the version where it occurred if that helps.

We have a somewhat common requirement to stick a copyright at the top of files to make lawyers happy. That copyright (with //) is now swapped with module level code comments (with ///). It all works but it's fairly ugly.

No problem if this is intended behaviour, I'll find a way around it if needed.

Extra information

  • The formatted result breaks by code.
  • The formatted result gives compiler warnings.
  • I or my company would be willing to help fix this.

Options

Fantomas master branch at 2022-03-10T17:18:56Z - c455e63

Default Fantomas configuration

Did you know that you can ignore files when formatting from fantomas-tool or the FAKE targets by using a .fantomasignore file?

@cgravill
Copy link
Member Author

cgravill commented Mar 11, 2022

In case it helps my case:

https://github.com/dotnet/fsharp/blob/d7bb97023b749298a4c0efc317c0797c7696201c/src/fsharp/AccessibilityLogic.fs#L1-L4

(Apologies if this crosses into stylistic discussion. It came as a behaviour change between versions which I wanted to check on. I can seek a ruling elsewhere)

@nojaf
Copy link
Contributor

nojaf commented Mar 11, 2022

Hey Colin, please try out https://www.nuget.org/packages/fantomas-tool/4.7.2

@cgravill
Copy link
Member Author

Amazing response time, thanks!

As a "reward" I've got more reports incoming. :-)

@nojaf
Copy link
Contributor

nojaf commented Mar 11, 2022

🙈😅 I already regret publishing 4.7 🙃
Also, somewhat related: https://blog.nojaf.com/2022/03/05/a-word-on-triple-slash-comments
Maybe some other problems you have are related to this as well.

@cgravill
Copy link
Member Author

Ah ha, you've already caught at least one: #2143

@nojaf
Copy link
Contributor

nojaf commented Mar 11, 2022

Yep, this going to be a bigger evil than I anticipated.

@cgravill
Copy link
Member Author

btw generally 4.7 is a nice improvement for us, fixes a bunch we were marked as ignore or manually reverting.

@nojaf
Copy link
Contributor

nojaf commented Mar 11, 2022

That is nice to hear, thank you for this feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants