PR 2730, "Fix" line-endings

Post here if you have re-based and finalised code to integrate into master, which was discussed, agreed to and tested in other forums. You can also submit your PR directly on github.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: PR 2730, "Fix" line-endings

Post by bernd »

it might makes sense to move the gitattributes file one directory up to the Mod dir and exclude the modules we would not normalize. Thus we would have only one gitattibutes and not one for each module.

example gitattributes would look like this: https://github.com/berndhahnebach/FreeC ... attributes

Code: Select all

# ****************************************************************************
# line endings

# for more information see forum topic and pull request
# https://forum.freecadweb.org/viewtopic.php?f=17&t=41117
# https://github.com/FreeCAD/FreeCAD/pull/2752


# get all used file types
# in a directory in a bash use
# find . -type f -name '*.*' | sed 's|.*\.||' | sort -u

# normalize the line endings of the following files

# standard files
*.bat text
*.cpp text
*.csv text
*.h text
*.md text
*.py text
*.qrc text
*.ts text
*.txt text
*.ui text
*.xml text
*.yml text

# Fem specific files
*.dat text
*.frd text
*.geo text
*.inp text
*.sif text
*.unv text
*.vtk text
*.z88 text




# exclude the following modules from normalize line endings
Assembly/** -text
Cam/** -text
Cloud/** -text
Drawing/** -text
Image/** -text
Import/** -text
Inspection/** -text
JtReader/** -text
Measure/** -text
Mesh/** -text
MeshPart/** -text
Part/** -text
PartDesign/** -text
Path/** -text
Plot/** -text
Points/** -text
Raytracing/** -text
ReverseEngineering/** -text
Robot/** -text
Sandbox/** -text
Ship/** -text
Sketcher/** -text
Spreadsheet/** -text
Start/** -text
Surface/** -text
TechDraw/** -text
TemplatePyMod/** -text
Test/** -text
Web/** -text

# they could be normalized as well, but they are not ATM
Complete/** -text
Idf/** -text
OpenSCAD/** -text
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: PR 2730, "Fix" line-endings

Post by bernd »

https://github.com/FreeCAD/FreeCAD/commit/5be60cf?w=1

all other module would change more than 10 file if they would normalized. As stated before the module maintainer should decide if and when line ending normalizing would be done. (IMHO)
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: PR 2730, "Fix" line-endings

Post by bernd »

Post Reply