Katalon automatically changes line endings between \r\n and \n constantly

Operating System

Windows 10

Katalon Studio version

8.4.1

Steps to reproduce

  1. Open/rename/move a file
  2. Check version tracking and see that it modified line endings seemingly randomly and arbitrarily (doesn’t happen with every file)

Expected Behavior
Katalon does not automatically change line-endings or allows a default line ending to be specified in the settings.

Actual Behavior
When opening, renaming, and moving files, Katalon will sometimes automatically make changes to line endings, changing \r\n to \n or vice versa. This is a problem for everyone on our team and happens nowhere else in the project–only Katalon. It happens in 1 of 2 ways:

The first is that a few lines get targeted, usually in the spaces at the beginning/end/between methods.

The second is that the entire file gets targeted, with every line showing a line ending change.

Screenshots / Videos (please attach screenshots or videos if necessary to reproduce the issue)
Example of specific lines being changed
Example of specific lines being changed
Example of entire file being changed (code excluded)
Example of entire file being changed (code excluded)

1 Like

I will report this to the Product Team to investigate the bug.

2 Likes

I did some more investigating and found that these 2 examples actually seem to be separate issues. The 1st example happens on lines that are otherwise empty besides whitespace. Katalon Studio seems to automatically remove the excess whitespace (would still be nice to toggle this off though). The 2nd example is the main issue described, however.

Git handles line endings, as documented:

If 2 or more members are working in a Git repository with different git config, a man A may have his git configured to convert CR+LF->LF when he makes a commit, another man B may have his git configured to convert LF->CR+LF when he makes a commint. In this case you may see the line ending of a file is changed by A and B; it may look irregular to you.

Your team should discuss and agree with a single Git config of the project for line ending.

I believe that Katalon does nothing about line endings.

I thought of that, but that’s why I specified that it doesn’t happen anywhere else in the project, only in Katalon. If it was a git issue, you would expect that the same thing happens in other editors, no?

Katalon Studio has a setting of line ending in the Preference menu.

How is it set on the machines of your team?

2 Likes

I’d assume default for everyone. To my knowledge, we’re all on windows, but I’ll check. I’m wondering if someone previously on the project from a long time ago used something besides windows, which would make only a handful of files use a different line ending. Then when we move or rename these files the line endings get changed to our default (windows). I’ll have to investigate.

Thank you; this is very helpful.

Edit: Okay yeah, so everyone is currently on windows and has always been on windows. So that theory is bust.