If you are viewing this issue and think it is a great idea, please vote with a 馃憤. Thanks in advance! Your feedback is appreciated. After all, Atom-Beautify is for you 馃槃 .
Not all beautifiers are written in Node.js and therefore require manual installation by users.
See https://github.com/Glavin001/atom-beautify#beautifiers for list of beautifiers and support.
Some users experience issues trying to install these dependencies on their own.
Can we make this process smoother? Or could we make this process automated? Better yet, could we make this process automatic, such that if the dependency is not already installed then Atom-Beautify will detect this and install it for the user, upon request?
Yes, I think we can.
Executables is a new feature being developed in this branch: https://github.com/Glavin001/atom-beautify/tree/feature/executables
Docker will allow us to abstract away most of the problems with cross-platform (i.e. Windows, Mac, Linux) installation.
Here are some useful Docker images:
Inspired by https://github.com/whalebrew/whalebrew-packages
php-cs-fixer --help vs docker run -it unibeautify/php-cs-fixer --help the former ran faster, however not by much.Here are the Docker images: https://hub.docker.com/u/unibeautify/
And the Git repository: https://github.com/Unibeautify/docker-beautifiers
More coming soon!
Published to v0.30.0
hi, i have installed docker pull unibeautify/php-cs-fixer and it works when docker run unibeautify/php-cs-fixer --help , but it doesnt works as looking for which path, i never used docker before, i wonder what path should i use in the beautifiers settings. thanks in advance (and sorry if this issue was not in the scope, it was the most similar i could find)
Hey @JDias ! Thank you for reaching out. Could you please provide a debug.md Gist link and I'll try to help you debug the issue. See https://github.com/Glavin001/atom-beautify/blob/master/docs/troubleshooting.md
Hi @glavin001 , i can do that but im almost sure that is a issue related to docker.
I installed portainer and i can see that the image is not running, and i fail to make it start.
I never used docker, so im big lost.(and the provided docker install directions doesnt give nothing more than the pull command)
can do that but im almost sure that is a issue related to docker.
Likely. And the debug.md Gist should point to that.
I installed portainer and i can see that the image is not running, and i fail to make it start.
This is expected. The Docker container for unibeautify/php-cs-fixer (and others) will run and then exit upon completion.
I never used docker, so im big lost.(and the provided docker install directions doesnt give nothing more than the pull command)
The pull command should be all you need, and Atom-Beautify should do the rest. The debug.md should tell us where Atom-Beautify went wrong.
Hi @Glavin001 thanks for the attention.
should i start a new issue? here is the link:
https://gist.github.com/JDias/f575266640b0b647453b0ac27bd62180
Ps: i manually added the php bin path
Maybe it was a root/non root issue? Before docker just worked with sudo, now it works without it. Dunno how the scan/probe code work and if a rerun could help.
What a nigthmare, man. I really appreciate your effort but I think it's not reasonable such difficulty to install a simple format plugin... This should work with a simple click or two... Several days trying to make it work with php, but it seems an impossible task.
I definitely agree. This experience is something I have been trying to improve for years. Unibeautify is a complete rewrite of Atom-Beautify with the goal to improve user experience while adding great new features.
Unfortunately, it is not so simple. The beautifiers for PHP are written in PHP, not JavaScript/Node.js. Therefore the integration is different and installation is separated using whatever package manager PHP requires. There are 4 different installation methods for PHP-CS-Fixer alone: https://github.com/FriendsOfPHP/PHP-CS-Fixer#installation
This is where I am investigating using Docker to normalize each of these various installation methods. See https://github.com/Unibeautify/docker-beautifiers
Since there are so many different user setups for external tools like PHP-CS-Fixer, Atom-Beautify has a builtin debugging tool to help us figure out what is wrong. It is almost always some kind of user error from operating system specific environment variable issues (ie. PATH not correct) to Atom-Beautify configuration.
For example, @JDias 's Gist:
2017-08-22T22:02:51.429Z - debug: [] spawn php-cs-fixer 0=fix, 1=--allow-risky=no, 2=--using-cache=no, 3=temp117722-3266-1qy1g09.444bpm0a4i.php
2017-08-22T22:02:51.512Z - debug: [] error Error: spawn php-cs-fixer ENOENT
at exports._errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
Looks like the PHP-CS-Fixer does not have a configured Executable path.
The important PATH environment variable is reported in the logs as well:
2017-08-22T22:02:51.417Z - debug: [] PATH: /home/jaime/.local/share/umake/bin:/home/jaime/bin:/home/jaime/.local/bin:/home/jaime/.local/share/umake/bin:/home/jaime/bin:/home/jaime/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
If php-cs-fixer is not found here, then there is no way for Atom-Beautify to find the program, regardless of whether it does exist somewhere.
@oxk4r01 : Please see https://github.com/Glavin001/atom-beautify/blob/master/docs/troubleshooting.md and create a Gist with your debugging information. Post a link here and we will try to help.
Also feel free to submit Pull Requests improving error messages or documentation.
Installed and "working" but the behavior is not correct. There are continuous problems with the indentation and when php and html are mixed (as in 99 % of projects occurs), the code ends completelly messed up. Not aproppiate for professional use at all (talking in therms of code formatting). I think this is an Atom's base problem, and a feature that should be addressed for the app by default, but to my knowledge, there isn't any package that could solve this question correctly. In other ides, such Netbeans, this format and beautyfying is zero problem and the results are perfect in one click. I like some of Atom's features very much (leaving appart issues such slowness and others), but the lack of implementation of basic features like this one is taking me to abandon it for basic productive reasons.
@oxk4r01 : Atom-Beautify does not perform any beautification, it wraps existing beautifiers in a unified experience.
See https://github.com/Glavin001/atom-beautify#language-support for language support. For PHP, two of the most populate would be:
If you are experiencing issues where the Atom-Beautify is correctly detecting PHP, however, the beautifier (PHP-CS-Fixer or PHPCBF) is not generating your desired result, I recommend you reach out to their respective GitHub pages with the links above.
If you need assistance determining if Atom-Beautify is working and which beautifier is being applied:
Please follow the issue template provided. More specifically, adding a link to the required
debug.mdGist which includes debugging information that answers our most commonly asked questions.
Thank you.
Hope this helps!