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

cabalfmt: use filepath arg instead of stdin #424

Closed
wants to merge 1 commit into from

Conversation

namedots
Copy link

@namedots namedots commented Jul 27, 2022

disclaimer: idk what I'm doing

my reasoning:
I wanted to let cabal-fmt auto-fill a field, but that didn't seem to be working due to current configuration feeding the content to cabal-fmt through stdin, so I wish to change it.
By default it seems neoformat uses a temporary path when passing file path by arg. That's also not good enough as cabal-fmt needs access to the project location.
I assume that the reason for using a temp path is that some tools make in-place changes. cabal-fmt only does so when asked to with -i, --in-place

does this break stuff for others?: I wouldn't know.

feel free to discard or whatever. I just made what seemed like an improvement to me, and figured out how to make the pull request.

cabal-fmt needs to know where the project is if it is to make use of
-- cabal-fmt: expand src
@namedots
Copy link
Author

oh. hold on. cabal-fmt would not receive changes in the buffer like this. that's no good.
and it doesn't do expansion when fed content on stdin.
and if doing it to a file in a temp path then it doesn't see the project and doesn't know how to expand.

meh.

@sbdchd
Copy link
Owner

sbdchd commented Jul 28, 2022

Sounds good!

@namedots
Copy link
Author

@sbdchd nonono hold up :<
it really should act on the buffer content, but my change throws that out of the window by instead supplying the file path.
no clue how I'm supposed to behave when I find problems after making the pull request.
still trying to figure this out.

@sbdchd sbdchd removed the automerge label Jul 28, 2022
@namedots
Copy link
Author

namedots commented Aug 2, 2022

I give up. I don't see how this could make sense. I'll close this and look for a corner to hide in. Maybe I managed to learn something at least.

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 this pull request may close these issues.

2 participants