Clang Format not-deterministic?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Clang Format not-deterministic?

Oleg Smolsky via cfe-dev
Hi All,

I've been noticing that clang-format either seems to be non-deterministic or there is a difference between "-i" and "-output-replacements-xml".

I.e. if you do:
$ clang-format -style=file -i source_code.cpp
$ clang-format -style=file -output-replacements-xml source_code.cpp

The second command outputs replacements...

Should I file a bug for this and if so, where?

Bram

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Clang Format not-deterministic?

Oleg Smolsky via cfe-dev
There is nothing non-deterministic about this, the behaviour is well-documented if you say "--help":

  -i                        - Inplace edit <file>s, if specified.

  -output-replacements-xml  - Output replacements as XML.


Bram De Jong via cfe-dev <[hidden email]> ezt írta (időpont: 2018. dec. 3., H, 11:30):
Hi All,

I've been noticing that clang-format either seems to be non-deterministic or there is a difference between "-i" and "-output-replacements-xml".

I.e. if you do:
$ clang-format -style=file -i source_code.cpp
$ clang-format -style=file -output-replacements-xml source_code.cpp

The second command outputs replacements...

Should I file a bug for this and if so, where?

Bram
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Clang Format not-deterministic?

Oleg Smolsky via cfe-dev
What I meant is that

1. running formatting first ( -i ... )
and then
2. running -output-replacements-xml afterwards, with exactly the same config

Should not give any replacements in -output-replacements-xml.
Or, am I wrong in assuming that?

Bram

On Mon, 3 Dec 2018 at 13:22, Whisperity <[hidden email]> wrote:
There is nothing non-deterministic about this, the behaviour is well-documented if you say "--help":

  -i                        - Inplace edit <file>s, if specified.

  -output-replacements-xml  - Output replacements as XML.


Bram De Jong via cfe-dev <[hidden email]> ezt írta (időpont: 2018. dec. 3., H, 11:30):
Hi All,

I've been noticing that clang-format either seems to be non-deterministic or there is a difference between "-i" and "-output-replacements-xml".

I.e. if you do:
$ clang-format -style=file -i source_code.cpp
$ clang-format -style=file -output-replacements-xml source_code.cpp

The second command outputs replacements...

Should I file a bug for this and if so, where?

Bram
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


--


Bram de Jong
Software Management

www.holoplot.com 

+49 (0)30 407 458 12

Holoplot GmbH
Ringbahnstr. 12 (10-14) / A2
12099 Berlin, Germany
Follow us on FacebookTwitter or LinkedIn.
Roman Sick – CEO | HRB183974B, Register Court Charlottenburg, Germany | EU Tax-Registration No. DE277000701 This e-mail contains confidential and/or privileged information. 
If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the information in this e-mail is strictly forbidden.

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev