-
Notifications
You must be signed in to change notification settings - Fork 83
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
Ormolu moves shebang from first line to the end of the file #377
Comments
Hmm, I cannot reproduce this. I get exactly the same source code unchanged if I run Ormolu. Are you using the latest version from current |
Interesting, I was re-checking this today and it indeed seems to be the case, not sure what happened yesterday. I'll look into this. |
The bug was related to how we extract shebangs from sources and convert them to comments. We generate spans for those comments manually and then the normal machinery for comments renders the shebangs. Interestingly we used a fixed file name |
@mavnn This is now fixed, nice catch! |
Thank you! I hadn't even had a chance to check if it still occurred on
Master (which I wasn't using direct!).
…On Sat, 14 Sep 2019 at 15:47, Mark Karpov ***@***.***> wrote:
@mavnn <https://github.com/mavnn> This is now fixed, nice catch!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#377?email_source=notifications&email_token=AACLQQFWNAUOU3RTYKBXWRLQJT2RNA5CNFSM4IWOKYMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6W5FNQ#issuecomment-531485366>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACLQQGUDQ7WSAY26IKE3JTQJT2RNANCNFSM4IWOKYMA>
.
|
Not fixed: #!/usr/bin/env stack
{-# LANGUAGE OverloadedStrings #-}
main = pure () is reformatted as {-# LANGUAGE OverloadedStrings #-}
#!/usr/bin/env stack
main = pure () |
Let's re-open this one then. Still this (and #393) is not going to make it in the first release. |
Write a simple Haskell script:
Run
ormolu
:Is it possible to make Ormolu aware of shebang lines at the beginning of files?
The text was updated successfully, but these errors were encountered: