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

astyle broken formatter #337

Open
Icy-Thought opened this issue Dec 25, 2024 · 7 comments · May be fixed by #348
Open

astyle broken formatter #337

Icy-Thought opened this issue Dec 25, 2024 · 7 comments · May be fixed by #348

Comments

@Icy-Thought
Copy link

You have to manually add the code provided below to your emacs configuration file for the apheleia astyle formatter to function as intended. Maybe we should upstream the solution that hlissner has come up with?

(setf (alist-get 'astyle apheleia-formatters)
        '("astyle" (mapconcat 'identity (apheleia-formatters-locate-file "--options=" ".astylerc"))))

Source: doomemacs/doomemacs#7718

@raxod502
Copy link
Member

Wait, I'm a bit confused by the discussion there. What's the proposed change? Seems like the mapconcat thing and the modified command-line option is contributed by the original reporter, who is confused that those modifications are not taking effect? What is the bug in Apheleia? I.e. what happens with the default configuration that's wrong?

@Icy-Thought
Copy link
Author

IIRC (not using astyle), but executing apehelia-format-buffer did not change the formatting of the viewed buffer. (command below)

'((astyle . ("astyle" (apheleia-formatters-locate-file
"--options" ".astylerc")))

But with the apheleia-formatters entry for astyle (found in doomemacs), it worked fine. I wonder what caused the issue tbh.

@raxod502
Copy link
Member

So the difference is... what? Using --options=.astylerc instead of --options .astylerc?

@Icy-Thought
Copy link
Author

From https://astyle.sourceforge.net/astyle.html#_Option_Files, that appears to be the case.

@raxod502
Copy link
Member

OK, I would accept that as a contribution. (Ideally it would be tested to verify that that's actually the issue.)

@Icy-Thought
Copy link
Author

I didn't submit a PR because I am not the owner of that code. But I can always create a PR if you'd like.

@raxod502
Copy link
Member

Up to you.

@Icy-Thought Icy-Thought linked a pull request Jan 27, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants