Skip to content

Commit 6d96d5b

Browse files
committed
[MERGE chakra-core#5583 @rhuanjl] Add end of file new line check fix chakra-core#496
Merge pull request chakra-core#5583 from rhuanjl:endOfFile Per issue chakra-core#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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+6
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

+1-1
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

+1-1
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

+1-1
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

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

lib/Backend/EquivalentTypeSet.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,4 +162,4 @@ void EquivalentTypeSet::SortAndRemoveDuplicates()
162162
this->sortedAndDuplicatesRemoved = true;
163163
}
164164
}
165-
#endif
165+
#endif

lib/Backend/GlobOpt.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -17464,4 +17464,4 @@ void GlobOpt::PRE::TraceFailedPreloadInLandingPad(const Loop *const loop, Proper
1746417464
Output::Print(_u("\n"));
1746517465
}
1746617466
}
17467-
#endif
17467+
#endif

lib/Backend/GlobOptIntBounds.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3242,4 +3242,4 @@ GlobOpt::EmitIntRangeChecks(IR::Instr* instr)
32423242
EmitIntRangeChecks(instr, instr->GetDst());
32433243
}
32443244
}
3245-
#endif
3245+
#endif

lib/Backend/IRBuilderAsmJs.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -314,4 +314,4 @@ class IRBuilderAsmJs
314314
#undef Uint8x16Type
315315
};
316316

317-
#endif
317+
#endif

lib/Backend/JitTransferData.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,4 @@ void JitTransferData::Cleanup()
115115
}
116116
midl_user_free(entries);
117117
}
118-
}
118+
}

lib/Backend/JitTransferData.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,4 @@ class JitTransferData
111111
void Cleanup();
112112
private:
113113
void EnsureJitTimeTypeRefs(Recycler* recycler);
114-
};
114+
};

lib/Backend/LowerMDShared.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -8633,4 +8633,4 @@ IR::BranchInstr*
86338633
LowererMD::InsertMissingItemCompareBranch(IR::Opnd* compareSrc, IR::Opnd* missingItemOpnd, Js::OpCode opcode, IR::LabelInstr* target, IR::Instr* insertBeforeInstr)
86348634
{
86358635
return this->lowererMDArch.InsertMissingItemCompareBranch(compareSrc, missingItemOpnd, opcode, target, insertBeforeInstr);
8636-
}
8636+
}

lib/Backend/LowerMDSharedSimd128.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3306,4 +3306,4 @@ BYTE LowererMD::Simd128GetTypedArrBytesPerElem(ValueType arrType)
33063306
return (1 << Lowerer::GetArrayIndirScale(arrType));
33073307
}
33083308

3309-
#endif
3309+
#endif

lib/Backend/NativeEntryPointData.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -566,4 +566,4 @@ OOPNativeEntryPointData::DeleteNativeDataBuffer(char * nativeDataBuffer)
566566
midl_user_free(buffer);
567567
}
568568

569-
#endif
569+
#endif

lib/Backend/NativeEntryPointData.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,4 +214,4 @@ class OOPNativeEntryPointData : public NativeEntryPointData
214214
#endif
215215
};
216216

217-
#endif
217+
#endif

lib/Backend/amd64/LowererMDArch.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3466,4 +3466,4 @@ LowererMDArch::InsertMissingItemCompareBranch(IR::Opnd* compareSrc, IR::Opnd* mi
34663466
}
34673467

34683468
return this->lowererMD->m_lowerer->InsertCompareBranch(missingItemOpnd, compareSrcUint64Opnd, opcode, target, insertBeforeInstr);
3469-
}
3469+
}

lib/Backend/amd64/machvalues.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ static const int MachStackAlignment = MachPtr;
1818
static const int MachArgsSlotOffset = MachPtr;
1919
static const int MachMaxInstrSize = 12;
2020
static const unsigned __int64 MachSignBit = 0x8000000000000000;
21-
static const int MachSimd128 = 16;
21+
static const int MachSimd128 = 16;

lib/Backend/arm/machvalues.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ static const int MachPtr = 4;
1616
static const int MachDouble = 8;
1717
static const int MachRegDouble = 8;
1818
static const int MachArgsSlotOffset = MachPtr;
19-
static const int MachStackAlignment = MachDouble;
19+
static const int MachStackAlignment = MachDouble;

lib/Backend/arm64/machvalues.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ static const int MachDouble = 8;
1818
static const int MachRegDouble = 8;
1919
static const int MachArgsSlotOffset = MachPtr;
2020
static const int MachStackAlignment = 16; // On ARM64 SP needs to be 16 byte aligned for load/store
21-
static const unsigned __int64 MachSignBit = 0x8000000000000000;
21+
static const unsigned __int64 MachSignBit = 0x8000000000000000;

lib/Backend/i386/LowererMDArch.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4224,4 +4224,4 @@ LowererMDArch::InsertMissingItemCompareBranch(IR::Opnd* compareSrc, IR::Opnd* mi
42244224
}
42254225

42264226
return this->lowererMD->m_lowerer->InsertCompareBranch(missingItemOpnd, compareSrcUint32Opnd, opcode, target, insertBeforeInstr);
4227-
}
4227+
}

lib/Backend/i386/machvalues.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ static const int MachMaxInstrSize = 11;
1818
static const int MachArgsSlotOffset = MachPtr;
1919
static const int MachStackAlignment = MachDouble;
2020
static const unsigned int MachSignBit = 0x80000000;
21-
static const int MachSimd128 = 16;
21+
static const int MachSimd128 = 16;

lib/Common/Core/Assertions.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,4 @@ struct IsSame<T1, T1>
140140
{
141141
IsTrue = true
142142
};
143-
};
143+
};

lib/Common/DataStructures/ClusterList.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -417,4 +417,4 @@ class SegmentClusterList
417417
Output::Print(_u("]\n"));
418418
}
419419
#endif
420-
};
420+
};

lib/Common/Memory/AllocatorTelemetryStats.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ struct AllocatorSizes
4242
size_t reservedBytes;
4343
size_t committedBytes;
4444
size_t numberOfSegments;
45-
};
45+
};

lib/Common/Memory/BucketStatsReporter.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,4 +188,4 @@ class BucketStatsReporter
188188
#endif
189189
};
190190

191-
};
191+
};

lib/Common/Memory/CollectionState.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,4 @@ enum CollectionState
102102
CollectionStateConcurrentMarkWeakRef = Collection_ConcurrentMark | Collection_ExecutingConcurrent | Collection_WeakRefMark,
103103
};
104104

105-
}
105+
}

lib/Common/Memory/CustomHeap.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1210,4 +1210,4 @@ CodePageAllocators<SectionAllocWrapper, PreReservedSectionAllocWrapper>::FreeLoc
12101210
} // namespace CustomHeap
12111211

12121212
} // namespace Memory
1213-
#endif // ENABLE_NATIVE_CODEGEN || DYNAMIC_INTERPRETER_THUNK
1213+
#endif // ENABLE_NATIVE_CODEGEN || DYNAMIC_INTERPRETER_THUNK

lib/Common/Memory/CustomHeap.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -579,4 +579,4 @@ BucketId GetBucketForSize(DECLSPEC_GUARD_OVERFLOW size_t bytes);
579579
void FillDebugBreak(_Out_writes_bytes_all_(byteCount) BYTE* buffer, _In_ size_t byteCount);
580580
} // namespace CustomHeap
581581
} // namespace Memory
582-
#endif
582+
#endif

lib/Common/Memory/DelayDeletingFunctionTable.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,4 @@ void DelayDeletingFunctionTable::DeleteFunctionTable(void* functionTable)
7878
NtdllLibrary::Instance->DeleteGrowableFunctionTable(functionTable);
7979
}
8080

81-
#endif
81+
#endif

lib/Common/Memory/HeapInfoManager.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,4 +210,4 @@ class HeapInfoManager
210210
size_t unusedPartialCollectFreeBytes;
211211
#endif
212212
};
213-
}
213+
}

lib/Common/Memory/RecyclerSweepManager.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -586,4 +586,4 @@ size_t RecyclerSweepManager::GetPendingMergeNewHeapBlockCount(HeapInfo const * h
586586
{
587587
return this->defaultHeapRecyclerSweep.GetPendingMergeNewHeapBlockCount(heapInfo);
588588
}
589-
#endif
589+
#endif

lib/Common/Memory/RecyclerSweepManager.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,4 @@ RecyclerSweepManager::GetHeapBlockCount(HeapBucketT<TBlockType> const * heapBuck
9797
return this->defaultHeapRecyclerSweep.GetHeapBlockCount(heapBucket);
9898
}
9999
#endif
100-
};
100+
};

lib/Common/Memory/XDataAllocator.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ struct DelayDeletingFunctionTable
3333
static bool IsEmpty();
3434
static void DeleteFunctionTable(void* functionTable);
3535
};
36-
#endif
36+
#endif

lib/Jsrt/JsrtDebugEventObject.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,4 @@ JsrtDebugDocumentManager::BreakpointDebugDocumentDictionary * JsrtDebugDocumentM
124124
}
125125
return breakpointDebugDocumentDictionary;
126126
}
127-
#endif
127+
#endif

lib/Jsrt/JsrtDebugManager.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -763,4 +763,4 @@ JsDiagDebugEvent JsrtDebugManager::GetDebugEventFromStopType(Js::StopType stopTy
763763

764764
return JsDiagDebugEventBreakpoint;
765765
}
766-
#endif
766+
#endif

lib/Jsrt/JsrtDebugUtils.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -497,4 +497,4 @@ const char16 * JsrtDebugUtils::GetDebugPropertyName(JsrtDebugPropertyId property
497497
Assert(false);
498498
return _u("");
499499
}
500-
#endif
500+
#endif

lib/Jsrt/JsrtDebuggerObject.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -952,4 +952,4 @@ void JsrtDebugStackFrames::ClearFrameDictionary()
952952
this->framesDictionary->Clear();
953953
}
954954
}
955-
#endif
955+
#endif

lib/Parser/BGParseManager.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -650,4 +650,4 @@ void BGParseWorkItem::WaitForCompletion()
650650

651651
this->complete->Wait();
652652
}
653-
}
653+
}

lib/Parser/BGParseManager.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,4 @@ class BGParseWorkItem sealed : public JsUtil::Job
150150
// Output data
151151
byte * bufferReturn;
152152
DWORD bufferReturnBytes;
153-
};
153+
};

lib/Parser/Parse.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1210,4 +1210,4 @@ class Parser
12101210
public:
12111211
charcount_t GetSourceIchLim() { return m_sourceLim; }
12121212
static BOOL NodeEqualsName(ParseNodePtr pnode, LPCOLESTR sz, uint32 cch);
1213-
};
1213+
};

lib/Parser/perrors.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,4 @@ LSC_ERROR_MSG(1092, ERRLabelBeforeAsyncFncDeclaration, "Labels not allowed befor
108108
LSC_ERROR_MSG(1093, ERRLabelBeforeClassDeclaration, "Labels not allowed before class declaration")
109109
LSC_ERROR_MSG(1094, ERRLabelFollowedByEOF, "Unexpected end of script after a label.")
110110
LSC_ERROR_MSG(1095, ERRFunctionAfterLabelInStrict, "Function declarations not allowed after a label in strict mode.")
111-
LSC_ERROR_MSG(1096, ERRAwaitAsLabelInAsync, "Use of 'await' as label in async function is not allowed.")
111+
LSC_ERROR_MSG(1096, ERRAwaitAsLabelInAsync, "Use of 'await' as label in async function is not allowed.")

lib/Parser/ptree.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1093,4 +1093,4 @@ template <OpCode nop> class OpCodeTrait;
10931093
typedef ParseNode##nk ParseNodeType; \
10941094
static const bool AllowDefer = ((ok) & fnopAllowDefer) != 0; \
10951095
};
1096-
#include "ptlist.h"
1096+
#include "ptlist.h"

lib/Runtime/Base/PerfHintDescriptions.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ PERFHINT_REASON(HeapArgumentsDueToWriteToFormals, true, PerfHintLevels::L1,
1515
PERFHINT_REASON(HeapArgumentsDueToNonLocalRef, true, PerfHintLevels::L1, _u("Arguments object not optimized as there were some nested functions or non-local refs found in nested functions"), _u("Scope object creation is required in this case"), _u("Check for nested functions and non-local refs inside") )
1616
PERFHINT_REASON(HeapArgumentsModification, true, PerfHintLevels::L1, _u("Modification to arguments"), _u("Slower lookups, high overhead in the JIT code"), _u("Avoid modification to the arguments"))
1717
PERFHINT_REASON(HeapArgumentsCreated, true, PerfHintLevels::L1, _u("Arguments object not optimized"), _u("Slower lookups, high overhead in the JIT code"), _u("Check the usage of arguments in the function"))
18-
PERFHINT_REASON(PolymorphicInilineCap, true, PerfHintLevels::L1, _u("Function has reached polymorphic-inline cap"), _u("This function will not inline more than 4 functions for this call-site."), _u("Check the polymorphic usage of this function"))
18+
PERFHINT_REASON(PolymorphicInilineCap, true, PerfHintLevels::L1, _u("Function has reached polymorphic-inline cap"), _u("This function will not inline more than 4 functions for this call-site."), _u("Check the polymorphic usage of this function"))

lib/Runtime/ByteCode/AsmJsByteCodeWriter.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,4 @@ namespace Js
130130
#undef IMP_IWASM
131131
#endif
132132

133-
#endif
133+
#endif

lib/Runtime/ByteCode/ByteCodeSerializeFlags.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
// of these flags to indicate how to allocate the memory. The absence of both flags
1212
// indicates that no allocation is needed.
1313
#define GENERATE_BYTE_CODE_COTASKMEMALLOC 0x00000008
14-
#define GENERATE_BYTE_CODE_ALLOC_ANEW 0x00000010
14+
#define GENERATE_BYTE_CODE_ALLOC_ANEW 0x00000010

lib/Runtime/ByteCode/OpCodes.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -862,4 +862,4 @@ MACRO_EXTEND_WMS( NewPropIdArrForCompProps, Reg1Unsigned1, OpSideEffect)
862862
#undef MACRO_WMS_WITH_DBG_ATTR
863863
#undef MACRO_EXTEND_WITH_DBG_ATTR
864864
#undef MACRO_EXTEND_WMS_WITH_DBG_ATTR
865-
#undef MACRO_BACKEND_ONLY_WITH_DBG_ATTR
865+
#undef MACRO_BACKEND_ONLY_WITH_DBG_ATTR

lib/Runtime/Debug/BreakpointProbe.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,4 @@ namespace Js
8686
statement->statement.begin = this->characterOffset;
8787
}
8888
}
89-
#endif
89+
#endif

lib/Runtime/Debug/DebugContext.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -411,4 +411,4 @@ namespace Js
411411
});
412412
}
413413
}
414-
#endif
414+
#endif

lib/Runtime/Debug/DebugDocument.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -352,4 +352,4 @@ namespace Js
352352
return TRUE;
353353
}
354354
}
355-
#endif
355+
#endif

lib/Runtime/Debug/DebugManager.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -233,4 +233,4 @@ AutoSetDispatchHaltFlag::~AutoSetDispatchHaltFlag()
233233
Assert(m_scriptContext->GetDebugContext()->GetProbeContainer()->IsPrimaryBrokenToDebuggerContext());
234234
m_scriptContext->GetDebugContext()->GetProbeContainer()->SetIsPrimaryBrokenToDebuggerContext(false);
235235
}
236-
#endif
236+
#endif

lib/Runtime/Debug/DebuggingFlags.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,4 @@ void DebuggingFlags::SetIsBuiltInWrapperPresent(bool value /* = true */)
7676
{
7777
m_isBuiltInWrapperPresent = value;
7878
}
79-
#endif
79+
#endif

0 commit comments

Comments
 (0)