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

Atom-beautify cannot detect installed Uncrustify #2526

Closed
2 of 5 tasks
shira952 opened this issue Oct 14, 2020 · 7 comments
Closed
2 of 5 tasks

Atom-beautify cannot detect installed Uncrustify #2526

shira952 opened this issue Oct 14, 2020 · 7 comments

Comments

@shira952
Copy link

Description

Atom-beautify return error when I run Beautify on Java file. Running which uncrustify return absolute path /usr/bin/uncrustify. Running uncrustify on terminal also return the command usage. Atom is v1.40, on Fedora 32.

Input Before Beautification

NA

Expected Output

NA

Actual Output

NA

Steps to Reproduce

  1. Install uncrustify using dnf install uncrustify
  2. Restart Atom
  3. Add code to Atom editor
  4. Run command Beautify
  5. atom-beautify return error "Could not find 'Uncrustify'. The program may not be installed."
  6. Add absolute path to Settings - Executables - Uncrustify
  7. Repeat step 2-4
  8. atom-beautify still return error "Could not find 'Uncrustify'. The program may not be installed."

Debug

2020-10-14T04:16:27.843Z - error: [beautifiers/index.coffee]  message=Could not find 'Uncrustify'. The program may not be installed., stack=Error: Could not find 'Uncrustify'. The program may not be installed.
    at Function.Executable.commandNotFoundError (/home/shira/.atom/packages/atom-beautify/src/beautifiers/executable.coffee:277:10)
    at HybridExecutable.Executable.commandNotFoundError (/home/shira/.atom/packages/atom-beautify/src/beautifiers/executable.coffee:269:18)
    at /home/shira/.atom/packages/atom-beautify/src/beautifiers/executable.coffee:115:25
    at tryCatcher (/home/shira/.atom/packages/atom-beautify/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/shira/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/home/shira/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/home/shira/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/home/shira/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:725:18)
    at _drainQueueStep (/home/shira/.atom/packages/atom-beautify/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/home/shira/.atom/packages/atom-beautify/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/home/shira/.atom/packages/atom-beautify/node_modules/bluebird/js/release/async.js:102:5)
    at Async.drainQueues (/home/shira/.atom/packages/atom-beautify/node_modules/bluebird/js/release/async.js:15:14)
    at process._tickCallback (internal/process/next_tick.js:68:7), code=CommandNotFound, errno=CommandNotFound, syscall=beautifier::run, file=Uncrustify, description=See Uncrustify installation instructions at https://github.com/Glavin001/atom-beautify#beautifiers or go to https://github.com/uncrustify/uncrustify
You can configure Atom Beautify with the absolute path to 'uncrustify' by setting 'Executable - Uncrustify - Path' in the Atom Beautify package settings.
Your program is properly installed if running 'which Uncrustify' in your Terminal returns an absolute path to the executable.

Checklist

I have:

  • Tried uninstalling and reinstalling Atom Beautify to ensure it installed properly
  • Reloaded (or restarted) Atom to ensure it is not a caching issue
  • Searched through existing Atom Beautify Issues at https://github.com/Glavin001/atom-beautify/issues
    so I know this is not a duplicate issue
  • Filled out the Input, Expected, and Actual sections above or have edited/removed them in a way that fully describes the issue.
  • Generated debugging information by executing Atom Beautify: Help Debug Editor command in Atom and added link for debug.md Gist to this issue
@russelldj
Copy link

I am having a similar issue with Ubuntu 18.04 and uncrustify installed from source. Uncrustify is on my PATH and I've also tried setting the absolute path in settings -> Executables -> Uncrustify -> Binary/Script Path to /usr/local/bin/uncrustify, which is the absolute location of the binary.

@jpmvferreira
Copy link

I'm facing the same issue on Manjaro, installing with sudo pacman -S uncrustify gives the same error when running beutify, even if the path is added manually.

@Boba0514
Copy link

Same, Manjaro for me as well. I managed to install it with docker, and that version does run, but that gives another error:

Parsing: input2021020-2657-8fogbq.c995t.ino as language CPP do_source_file: Unable to create output2021020-2657-14p6ysa.fbh7.ino: Permission denied (13)

Parsing: input2021020-2657-8fogbq.c995t.ino as language CPP
do_source_file: Unable to create output2021020-2657-14p6ysa.fbh7.ino: Permission denied (13)
Hide Stack Trace
Error: Parsing: input2021020-2657-8fogbq.c995t.ino as language CPP
do_source_file: Unable to create output2021020-2657-14p6ysa.fbh7.ino: Permission denied (13)
    at /home/boba/.atom/packages/atom-beautify/src/beautifiers/executable.coffee:183:23
    at tryCatcher (/home/boba/.atom/packages/arduino-upload/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/boba/.atom/packages/arduino-upload/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/home/boba/.atom/packages/arduino-upload/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/home/boba/.atom/packages/arduino-upload/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/home/boba/.atom/packages/arduino-upload/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (/home/boba/.atom/packages/arduino-upload/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/home/boba/.atom/packages/arduino-upload/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/home/boba/.atom/packages/arduino-upload/node_modules/bluebird/js/release/async.js:102:5)
    at Async.drainQueues (/home/boba/.atom/packages/arduino-upload/node_modules/bluebird/js/release/async.js:15:14)
    at processTicksAndRejections (internal/process/task_queues.js:89:5)

@Tomaqa
Copy link

Tomaqa commented Sep 1, 2021

Same for me ("Could not find 'Uncrustify'". setting the executable does not help).
I wonder whether the fact that it is not being printed in lowercase ('uncrustify') is not causing any trouble (especially the suggestion 'which Uncrustify' which will indeed fail).
Also, I noticed that the version of the system-wide uncrustify differs from the one that is mentioned in the package's config files.

@hamar030
Copy link

hamar030 commented Jun 4, 2022

the error is on /atom-beautify/blob/master/src/beautifiers/uncrustify/index.coffee line 21 that can't read uncrustify version,
current version uncrustify on manjaro is: uncrustify --version: Uncrustify_d-0.74.0_f

so i can fix it on my pc by rewrite that line with parse: (text) -> text.match(/(U|u)ncrustify.{1,3}(\d+\.\d+\.\d)/)[2]
but i am not sure it was working on other os or not.

@SilentGlasses
Copy link

If you still need this and are looking for something to fill the spot that Atom left, I am using Pulsar the successor to Atom... This package is working except for one deprecated error listed in #2605

If you don't need this anymore, can you please close this out so it's not just sitting there? Thanksv

@shira952
Copy link
Author

shira952 commented Feb 1, 2023

Okay I'll close this as I no longer require the beautifier.

Personal advice, for those still using Atom-beautify and facing this issue better use external beautifier and copy paste the result into Atom to avoid headache.

@shira952 shira952 closed this as completed Feb 1, 2023
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

No branches or pull requests

7 participants