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

Removing brackets may need to insert spaces #1179

Closed
expipiplus1 opened this issue Dec 9, 2020 · 5 comments · Fixed by mpickering/apply-refact#104 or #1206
Closed

Removing brackets may need to insert spaces #1179

expipiplus1 opened this issue Dec 9, 2020 · 5 comments · Fixed by mpickering/apply-refact#104 or #1206

Comments

@expipiplus1
Copy link
Contributor

expipiplus1 commented Dec 9, 2020

Consider:

x = do(y)

Hlint currently removes the brackets leaving

x doy

Seems to happen for all keywords

@ndmitchell
Copy link
Owner

Given:

x = do(this is a test)

We produce after refactoring:

x = dothis is a test

Which is driven by the refactoring tool:

[("Sample.hs:1:7-22: Suggestion: Redundant bracket\nFound:\n  do (this is a test)\nPerhaps:\n  do this is a test\n",[Replace {rtype = Expr, pos = SrcSpan {startLine = 1, startCol = 7, endLine = 1, endCol = 23}, subts = [("x",SrcSpan {startLine = 1, startCol = 8, endLine = 1, endCol = 
22})], orig = "x"}])]

I don't think there's anything else we could send, so I guess this one should be a bug for apply-refact? @zliu41 ?

@zliu41
Copy link
Collaborator

zliu41 commented Dec 12, 2020

Yeah this looks like a bug in apply-refact.

@expipiplus1
Copy link
Contributor Author

Ah, makes sense. happy to close this or leave it open as a tracking issue.

@ndmitchell
Copy link
Owner

Let's leave this as a tracking issue.

@expipiplus1
Copy link
Contributor Author

Thanks!

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