Skip to content

Commit 6d96d5b

Browse files
committed
[MERGE #5583 @rhuanjl] Add end of file new line check fix #496
Merge pull request #5583 from rhuanjl:endOfFile Per issue #496 augment the existing line ending check to also check to ensure that each file ends in a newline. Note, per logic in check_eol.sh this test is run only on: 1. Files edited in the current PR 2. Files that are not JS test files OR any cmd, baseline, wasm, vcxproj or sln files Also note: 1. As this runs only on files edited din current PR it won't catch any historic mistakes 2. It doesn't check JS test files - this seemed odd to me but chose to leave it CC @dilijev
2 parents 8216761 + 2ee13d2 commit 6d96d5b

File tree

91 files changed

+96
-90
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+96
-90
lines changed

Build/Chakra.Build.Clang.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,4 +126,4 @@
126126
>
127127
</CL>
128128
</Target>
129-
</Project>
129+
</Project>

Build/NuGet/Microsoft.ChakraCore.vc140.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@
3737
<ReferenceCopyLocalPaths Include="$(MSBuildThisFileDirectory)..\..\lib\native\v140\x86\Release\ChakraCore.dll" />
3838
<ReferenceCopyLocalPaths Include="$(MSBuildThisFileDirectory)..\..\lib\native\v140\x86\Release\ChakraCore.pdb" />
3939
</ItemGroup>
40-
</Project>
40+
</Project>

Build/NuGet/package.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ Foreach ($nuspec in $(Get-Item $packageRoot\*.nuspec))
4747
If (Test-Path $compiledNuspec)
4848
{
4949
Remove-Item $compiledNuspec
50-
}
50+
}

bin/ch/262.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ var $262 = {
2828
getReport: function () { return WScript.GetReport(); },
2929
},
3030
};
31-
)===="
31+
)===="

jenkins/check_eol.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fi
1515
ERRFILE=check_eol.sh.err
1616
rm -f $ERRFILE
1717

18-
git diff --name-only `git merge-base origin/master HEAD` HEAD | grep -v -E "(test/.*\\.js|\\.cmd|\\.baseline|\\.wasm|\\.vcxproj|\\.vcproj|\\.sln)" | xargs -I % ./jenkins/check_file_eol.sh %
18+
git diff --name-only `git merge-base origin/master HEAD` HEAD | grep -v -E "(test/.*\\.js|\\.cmd|\\.baseline|\\.wasm|\\.wast|\\.vcxproj|\\.vcproj|\\.sln)" | xargs -I % ./jenkins/check_file_eol.sh %
1919

2020
if [ -e $ERRFILE ]; then # if error file exists then there were errors
2121
>&2 echo "--------------" # leading >&2 means echo to stderr

jenkins/check_file_eol.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,10 @@ if [ $? -eq 0 ]; then # grep found matches ($?==0), so we found CR (0x0d) in the
3737
echo "--------------" >> $ERRFILE # same length as '--- ERRORS ---'
3838
fi
3939

40+
# Check that each file ends in a newline character
41+
tail -c1 $1 | od -x | grep '000a' > $ERRFILETEMP
42+
if [ $? -ne 0 ]; then # last character is not a newline
43+
echo "ERROR: $1 does not end in a new line" >> $ERRFILE
44+
fi
45+
4046
rm -f $ERRFILETEMP

lib/Backend/AsmJsJITInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,4 @@ AsmJsJITInfo::AccessNeedsBoundCheck(uint offset) const
9797
{
9898
return offset >= 0x10000;
9999
}
100-
#endif
100+
#endif

lib/Backend/BackendOpCodeAttrAsmJs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ namespace OpCodeAttrAsmJs
6868
}
6969

7070
}; // OpCodeAttrAsmJs
71-
#endif
71+
#endif

lib/Backend/BackendOpCodeAttrAsmJs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ namespace OpCodeAttrAsmJs
1212
bool HasProfiledOp(Js::OpCodeAsmJs opcode);
1313
bool IsProfiledOp(Js::OpCodeAsmJs opcode);
1414
};
15-
#endif
15+
#endif

lib/Backend/CodeGenNumberAllocator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,4 +571,4 @@ XProcNumberPageSegmentManager::~XProcNumberPageSegmentManager()
571571
temp = (XProcNumberPageSegmentImpl*)next;
572572
}
573573
}
574-
#endif
574+
#endif

0 commit comments

Comments
 (0)