-
Notifications
You must be signed in to change notification settings - Fork 32
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
don't reformat regexp /litterals/ #16
Comments
The failing code is available in https://github.com/vicb/angular/tree/0623-regexp.fail |
Could you give a short example of the code that fails? It's a bit hard to dig out of an entire Angular tree. |
see my branch above, specifically angular/angular@master...vicb:0623-regexp.fail#diff-c59545575c57eef05523564f7fc50c10R491 and the few regexps below angular/angular@master...vicb:0623-regexp.fail#diff-d5560959c2720b6f102bd4de3ad13006R29 |
So I find two issues. Wraps before var re = /polyfill-next-selector[^+}]*content:[\s]*?['"](.*?)['"][;\s]*}([^{]*?){/gim; Trailing var x = / "/g;
foo(); If there's anything else wrong, please paste the actual failing regular expression into this issue; it's too hard to find some incorrect formatting in the messy github diff with lots of other changes. |
|
And that should be it. |
There is actually one more occurrence now with the latest clang. Look for |
Could you just post the code that fails to format here @vicb? |
|
These all seem to work fine, with the sole exception of having a RegExp as a top level expression, e.g. /foo/g.test('foo'); But that code is never useful, so I think we should just ignore it for the moment. |
What do you mean ??? |
If I enable clang-formatting by removing the comments and format the code above with clang-format 1.0.25, the result is ok, except for the top level regexp expressions. Or am I missing something? |
Let me re-check but the one in the middle is new after having rebased yesterday. |
|
The new one still fails (former are fine now)
->
shadow - deep, no it's not a minus op |
Original code is:
|
So the actual code that fails formatting is (without the var _shadowDOMSelectorsRe = [
/>>>/g,
/::shadow/g,
/::content/g,
/\/deep\//g, // former >>>
/\/shadow-deep\//g, // former /deep/
/\/shadow\//g, // former ::shadow
]; |
I just released clang-format v1.0.26 that should fix this. |
see angular/angular#2695
/cc @mprobst
The text was updated successfully, but these errors were encountered: