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

Need option to ignore brace style #538

Closed
c32hedge opened this issue Sep 25, 2014 · 6 comments
Closed

Need option to ignore brace style #538

c32hedge opened this issue Sep 25, 2014 · 6 comments

Comments

@c32hedge
Copy link
Contributor

"Where to stick your stupid braces" is a common hot button for many teams so having to choose between collapse, expand, and end-expand will force us to either fight that battle or choose a different tool. Can we get an "ignore" option for -b | --brace-style, or else a separate --keep-brace-style option?

@bitwiseman bitwiseman added this to the Future milestone Sep 25, 2014
@bitwiseman
Copy link
Member

So, you want effectively a 'brace-style=none' option? How would that work? Just leave the braces where they are? By what definition?

Interesting idea, but lower priority than a number of other feature requests.

You should feel free to implement with tests and submit a pull request and we can discuss further.

@c32hedge
Copy link
Contributor Author

"where they are" === if on the same line (like collapse), leave them there but fix any whitespace
if on separate line (like expand), leave them there but fix any whitespace / indentation

I've started playing with the code and the first attempt (trying to hack code after reading existing code for 5 minutes) failed horribly, as expected. Will continue poking as I have time.

'brace-style=none' does sound better than 'brace-style=ignore'

@c32hedge
Copy link
Contributor Author

That seems to do the trick--never used npm test before and I can't get the original to work yet on my machine so still WIP

@bitwiseman
Copy link
Member

Looks like a good start.

c32hedge added a commit to c32hedge/js-beautify that referenced this issue Oct 7, 2014
bitwiseman added a commit that referenced this issue Oct 7, 2014
Update documentation of brace style options (related to #538 and #554)
@bitwiseman bitwiseman modified the milestones: v1.5.2, Future Jun 16, 2015
@devken-net
Copy link

Can we really implement "ignore" all braces? I mean ignore opening and closing braces but still fix any whitespaces in between braces?
Currently I'm coding reactjs using babel es6 and some decorations. I used more functional programming and most of it I wanted to remain in the same line.

When I use "brace_style": "none" the first brace will remain on the same line while the closing brace will be on the next line.

I hope to see this feature on https://github.com/victorporof/Sublime-HTMLPrettify

@bitwiseman
Copy link
Member

If you see a problem, please file a new issue and reference this one.
Also, provide config settings, input, actual output, desired output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants