This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Do not emit replacements if Java imports are OK
ClosedPublic

Authored by krasimir on Feb 20 2019, 3:34 AM.

Details

Summary

Currently clang-format would always emit a replacement for a block of Java imports even if it is correctly formatted:

% cat /tmp/Aggregator.java
import X;
% clang-format /tmp/Aggregator.java
import X;
% clang-format -output-replacements-xml /tmp/Aggregator.java
<?xml version='1.0'?>
<replacements xml:space='preserve' incomplete_format='false'>
<replacement offset='0' length='9'>import X;</replacement>
</replacements>
%

This change makes clang-format not emit replacements in this case. Note that
there is logic to not emit replacements in this case for C++.

Diff Detail

Repository
rL LLVM

Event Timeline

krasimir created this revision.Feb 20 2019, 3:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 20 2019, 3:34 AM
ioeric accepted this revision.Feb 20 2019, 3:37 AM
This revision is now accepted and ready to land.Feb 20 2019, 3:37 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 20 2019, 3:43 AM