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

Apply Hint removes shebang line at top of file #140

Open
OwenGraves opened this issue Jun 22, 2023 · 0 comments · May be fixed by #148
Open

Apply Hint removes shebang line at top of file #140

OwenGraves opened this issue Jun 22, 2023 · 0 comments · May be fixed by #148

Comments

@OwenGraves
Copy link

For example, applying "Redundant $" clears the first line of the file, so #!/usr/bin/env cabal is removed.
Before:

#!/usr/bin/env cabal

{- cabal:
build-depends: base
-}

main :: IO ()
main = print $ "test"

After:



{- cabal:
build-depends: base
-}

main :: IO ()
main = print "test"

This can be reproduced on refactor --version v0.13.0.0 with ghc 9.4.4 by running
hlint Test.hs --serialise > hlint-refactor
refactor Test.hs --refact-file hlint-refactor
with hlint-refactor containing

[("Test.hs:8:14: Suggestion: Redundant $\nFound:\n  print $ \"test\"\nPerhaps:\n  print \"test\"\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 8, startCol = 8, endLine = 8, endCol = 22}, subts = [("a",SrcSpan {startLine = 8, startCol = 8, endLine = 8, endCol = 13}),("b",SrcSpan {startLine = 8, startCol = 16, endLine = 8, endCol = 22})], orig = "a b"}])]

Looks related to this issue

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

Successfully merging a pull request may close this issue.

1 participant