primefaces: Inconsistent Line Ending: Mix of CRLF and LF in the Repository - moment.js in particular
1) Environment
- PrimeFaces version: Primefaces Trunk
- Does it work on the newest released PrimeFaces version? Version? No
- Does it work on the newest sources in GitHub? (Build by source -> https://github.com/primefaces/primefaces/wiki/Building-From-Source)
- Application server + version: N/A
- Affected browsers: N/A
2) Expected behavior
All files should be committed with Unix Style ended with LF. (Almost all files are ended with LF by the way)
3) Actual behavior
Some files were committed with Windows Style CRLF (Actually, there is one as far as I can tell: moment.js). As a result, For any of those files, git diff will see the whole file as changed when it’s not
4) Steps to reproduce
Use bash command:
cat -A [the following file]
...
hooks.HTML5_FMT = {^M$
DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // <input type="datetime-local" />^M$
DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // <input type="datetime-local" step="1" />^M$
DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // <input type="datetime-local" step="0.001" />^M$
DATE: 'YYYY-MM-DD', // <input type="date" />^M$
TIME: 'HH:mm', // <input type="time" />^M$
TIME_SECONDS: 'HH:mm:ss', // <input type="time" step="1" />^M$
TIME_MS: 'HH:mm:ss.SSS', // <input type="time" step="0.001" />^M$
WEEK: 'YYYY-[W]WW', // <input type="week" />^M$
MONTH: 'YYYY-MM' // <input type="month" />^M$
};^M$
^M$
return hooks;^M$
...
Note that ^M$ means CRLF
Pick another file (the normal case):
use the same cat command
$
if(!row.parent().attr('tabindex')) {$
this.frozenTbody.trigger('focus');$
}$
},$
$
//@Override$
saveColumnOrder: function() {$
var columnIds = [],$
columns = $(this.jqId + '_frozenThead:first th,' + this.jqId + '_scrollableThead:first th');$
$
columns.each(function(i, item) {$
columnIds.push($(item).attr('id'));$
});$
$
this.orderStateHolder.val(columnIds.join(','));$
}$
$
});$
Note that $ means LF
5) Thought
For cross platform development, it is recommended to use a consistent line ending. Since almost all the files are currently ended with LF, the moment.js should be also ended with LF instead CRLF.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 17 (17 by maintainers)
Commits related to this issue
- Fix #3834 - Use LF instead of CRLF — committed to jxmai/primefaces by deleted user 6 years ago
- Merge pull request #3835 from jxmai/PF_3834 Fix #3834 - Use LF instead of CRLF — committed to primefaces/primefaces by tandraschko 6 years ago
- Fix #3834 - LF instead of CRLF — committed to jxmai/primefaces by deleted user 6 years ago
- Merge pull request #3845 from jxmai/PF_3834_2 Fix #3834 - LF instead of CRLF — committed to primefaces/primefaces by tandraschko 6 years ago
- Fix #3834 - LF instead of CRLF — committed to jxmai/primefaces by deleted user 6 years ago
- Merge pull request #3852 from jxmai/PF_3834_3 Fix #3834 - LF instead of CRLF — committed to primefaces/primefaces by tandraschko 6 years ago
OK to get my fork back to out of “hell” I had to do this and now everything is all good!