Problem
Using IntelliJ IDE Git Client, trailing white spaces in files are being removed automatically, causing unrelated changes in code. This leads to pull requests being rejected as they include unintentional modifications.
Cause
Files may be auto-formatted on saving
Resolution
Option 1. "Remove trailing spaces" is triggered automatically
To resolve, uncheck "Settings | Tools | Actions on Save | Reformat code" to disable all reformatting.
To prevent removing new lines in all files, go to "Settings | Editor | General | On save | Remove Trailing spaces on:" and uncheck.
To fine-tune the settings for the specific language, go to "Settings | Editor | Code Style | Language_name" and adjust "Blank lines" settings
Option 2. Editor config file turned on.
This issue may by caused by the EditorConfig file being enabled in the project. EditorConfig settings overwrite IDE configurations and enforce rules like trimming trailing spaces.
Remove .editorconfig file from the project folder to prevent this
Comments
0 comments
Please sign in to leave a comment.