Feature Request: format changed lines before commit
已回答
IntelliJ already offers to reformat files before committing them. Although I like this feature I have it disabled because it imposes the risk of merge conflicts on lines I haven't actively changed. It would however be nice if IntelliJ could automatically reformat those lines I have actually changed. Either before committing or on saving the file.
请先登录再写评论。
Could you please clarify? The Reformat option affects only changed parts, not the entire file.
An example with screenshots appreciated.
Also, there is automatic "magic" conflict resolution, isn;t it of any help with such merges?
> The Reformat option affects only changed parts, not the entire file.
Ok, now I feel a bit stupid. This is totally true. I've unchecked the auto format feature years ago maybe this has changed since then. I'll add this as default again.
Thx for your answer
> Also, there is automatic "magic" conflict resolution, isn;t it of any help with such merges?
It does not help if a team mate changes a line which was formatted by me.
Actually, this is not true at least with Idea 18.1 and groovy file. Reformat triggers whole file to be reformatted