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

Preserve Newlines when running PrettifyCommand #86

Open
garretthyder opened this issue Feb 3, 2020 · 6 comments
Open

Preserve Newlines when running PrettifyCommand #86

garretthyder opened this issue Feb 3, 2020 · 6 comments
Labels
prettify Code prettify issue or request.

Comments

@garretthyder
Copy link
Contributor

Hello @amostajo,

Testing the PrettifyCommand I found it stripped all empty lines from my code causing everything to be bunched together and harder to read. It would be nice if it's possible to keep newlines preserved.

Thanks

@amostajo
Copy link
Contributor

@garretthyder Sorry, have been a bit busy the past days, will resume checking on these issues.

@amostajo
Copy link
Contributor

@garretthyder Can you please show the piece of syntax that didn't preserve the new lines?

@amostajo amostajo added bug prettify Code prettify issue or request. and removed bug labels Feb 13, 2020
@garretthyder
Copy link
Contributor Author

Hi @amostajo no worries, sorry for my delayed response.

Here's the before/after of the prettify command on my in progress project;
https://gist.github.com/garretthyder/07f2729b6a297cd100d386aa6bb00446

The first thing to note is the new lines between code gets stripped as does some that was surrounding functions.

Also note some oddities that occur with the conditional becoming multi-line and only one of the add_assets becoming multiline.

@amostajo
Copy link
Contributor

amostajo commented Apr 4, 2020

Umm, ok lets review what we can do, in the meantime you can user option --nopretty to preserve your double lines.

Example:

php ayuco add:init ConfigController@init --nopretty --comment="Configuration settings."

@amostajo
Copy link
Contributor

amostajo commented Apr 4, 2020

Btw...

For this:

$this->add_action( 'admin_menu', 'AdminController@menu' );

Try the addon:
https://github.com/10quality/wpmvc-addon-administrator

@garretthyder
Copy link
Contributor Author

Thanks @amostajo sounds good, I'll use nopretty for the time being.

And that addon looks awesome, I'll delve in and add it to my roadmap for a future update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prettify Code prettify issue or request.
Projects
None yet
Development

No branches or pull requests

2 participants