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

More verbose output #103

Open
muuvmuuv opened this issue Oct 24, 2018 · 11 comments
Open

More verbose output #103

muuvmuuv opened this issue Oct 24, 2018 · 11 comments

Comments

@muuvmuuv
Copy link

I had to beautify a file over 5000 lines of code and it was really depressing to see no output at all. I killed the process a few seconds after because I didn't know if it had really started. We could add a progress bar or just some colored text that says something. This would help users to not kill the process and wait for a result.

@lassik
Copy link
Contributor

lassik commented Oct 24, 2018

What language and beautifier did you use? I think any beautifier should be able to handle a file of 5000 lines in a few seconds (probably faster), so there's probably some other problem. It could be a bug in the beautifier plugin.

@lassik
Copy link
Contributor

lassik commented Oct 24, 2018

In any case, you're right, having the usual -v / --verbose flag would probably be good also.

@muuvmuuv
Copy link
Author

muuvmuuv commented Oct 24, 2018

@lassik I pass in the --language html so my command is unibeautify table.html --language html. If you want to test it, here is the HTML, simply grab the HTML from the main content.

Edit: it seems to not even work with a simple 40 line html file.

@muuvmuuv
Copy link
Author

This is my list of installed packages globally:

→ npm list -g --depth 0
/usr/local/lib
├── @angular/cli@6.2.4
├── @unibeautify/beautifier-csscomb@0.1.0
├── @unibeautify/beautifier-eslint@0.6.0
├── @unibeautify/beautifier-prettier@0.9.0
├── @unibeautify/beautifier-prettydiff@0.6.0
├── @unibeautify/beautifier-tslint@0.1.0
├── @unibeautify/cli@0.4.0
├── cosmiconfig@5.0.6
├── csscomb@4.2.0
├── eslint@5.7.0
├── eslint-plugin-react@7.11.1
├── js-beautify@1.8.8
├── nativescript@4.2.4
├── nodemon@1.18.4
├── npm@6.4.1
├── prettier@1.14.3
├── prettydiff2@2.2.7
├── sort-package-json@1.15.0
├── stylelint@9.6.0
├── tslint@5.11.0
├── typescript@3.1.1
├── unibeautify@0.17.0
├── vsce@1.51.1
├── webpack@4.20.2
└── yo@2.0.5

@stevenzeck
Copy link
Contributor

More verbose outputs for certain actions are a good idea. But I don't know how much I would do for a simple beautification of a file.

But it shouldn't hang like that. That's something to look into.

@stevenzeck
Copy link
Contributor

stevenzeck commented Oct 25, 2018

Looks like requireg made some changes and the cli no longer loads beautifiers. Not sure why it hangs exactly. Edit: Actually might be a node change.

@muuvmuuv
Copy link
Author

@stevenzeck something like this would be great, especially when more files are being beautified: https://www.npmjs.com/package/cli-spinner.

@stevenzeck
Copy link
Contributor

@muuvmuuv I don't disagree, but the issue you described originally won't be fixed with verbose output. You are running unibeautify table.html --language html, which has two issues:

  1. You need to specify --file-path (-f) before table.html, that is what is causing it to hang. The cli should handle this properly and exit, or pick up the file name without it.

  2. Unibeautify core should be a little more flexible when passing in the language name. In this case it won't find the language because html should be capitalized.

If you run unibeautify --file-path table.html --language HTML it should work

@stevenzeck
Copy link
Contributor

I've opened #106 to fix the hang issue, it will either return Cannot find language. or No text in the file or stdin.

@muuvmuuv
Copy link
Author

@stevenzeck oh didn‘t know that, I assumed it works like prettier (passing the file and it just works). Thanks for the solution, but we may should change this so users don‘t need to capitalize letters in the CLI, not everyone knows the correct lettering of every language. But we discussed this already in another issue.

Anyway a verbose flag would be good to display some more info when debugging, fixing errors or when something did not work and we want the user to show us the verbose information.

Sent with GitHawk

@stevenzeck
Copy link
Contributor

Can you open an issue in Unibeautify core for the language issue? Relevant lines are in LanguageManager.ts 18 and 25

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

3 participants