chore: enforce InsertNewlineAtEOF
in clang-format
(#4343)
* style: insert newline at eof * style: use `InsertNewlineAtEOF` in `clang-format` * fix: use `clang-format-16` * chore: update clang-format-lint-action to v0.16.2 --------- Co-authored-by: Debasish Biswas <debasishbsws.dev@gmail.com>
This commit is contained in:
parent
78ca465b1e
commit
f010a47608
@ -83,6 +83,7 @@ IndentGotoLabels: true
|
||||
IndentPPDirectives: None
|
||||
IndentWidth: 4
|
||||
IndentWrappedFunctionNames: false
|
||||
InsertNewlineAtEOF: true
|
||||
JavaScriptQuotes: Leave
|
||||
JavaScriptWrapImports: true
|
||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||
|
4
.github/workflows/clang-format-lint.yml
vendored
4
.github/workflows/clang-format-lint.yml
vendored
@ -9,8 +9,8 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: DoozyX/clang-format-lint-action@v0.13
|
||||
- uses: DoozyX/clang-format-lint-action@v0.16.2
|
||||
with:
|
||||
source: './src'
|
||||
extensions: 'java'
|
||||
clangFormatVersion: 12
|
||||
clangFormatVersion: 16
|
||||
|
@ -98,4 +98,4 @@ public class AllPathsFromSourceToTarget {
|
||||
return nm;
|
||||
// returns all possible paths from source to destination
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -26,4 +26,4 @@ public class ArrayCombination {
|
||||
}
|
||||
return Combination.combination(arr, length);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,4 +25,4 @@ public class IndexOfRightMostSetBit {
|
||||
|
||||
return index;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,4 +9,4 @@ public class IsEven {
|
||||
public static boolean isEven(int number) {
|
||||
return (number & 1) == 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,4 +14,4 @@ public class NonRepeatingNumberFinder {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,4 +10,4 @@ public class NumbersDifferentSigns {
|
||||
public static boolean differentSigns(int num1, int num2) {
|
||||
return (num1 ^ num2) < 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,4 +17,4 @@ public class ReverseBits {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -111,4 +111,4 @@ public class LeftistHeap {
|
||||
lst.add(n.element);
|
||||
in_order_aux(n.right, lst);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -109,4 +109,4 @@ public class Fibonacci {
|
||||
int nthTerm = (int) ((Math.pow(phi, n) - Math.pow(-phi, -n)) / squareRootOf5);
|
||||
return nthTerm;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -126,4 +126,4 @@ public class OptimalJobScheduling {
|
||||
public int getCost(int process, int machine) {
|
||||
return Cost[process][machine];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,4 +17,4 @@ public class PowerUsingRecursion {
|
||||
// Recurse with a smaller exponent and multiply with base
|
||||
return base * power(base, exponent - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -51,4 +51,4 @@ public class PreemptivePriorityScheduling {
|
||||
|
||||
return ganttChart;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -103,4 +103,4 @@ public class DualPivotQuickSort implements SortAlgorithm {
|
||||
/*
|
||||
* References: https://www.geeksforgeeks.org/dual-pivot-quicksort/
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
@ -58,4 +58,4 @@ public class StringCompression {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -54,4 +54,4 @@ public class AllPathsFromSourceToTargetTest {
|
||||
list2 = list1;
|
||||
assertIterableEquals(list1, list2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,4 +29,4 @@ public class WordSearchTest {
|
||||
String word = "ABCB";
|
||||
Assertions.assertFalse(ws.exist(board, word));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,4 +17,4 @@ class IndexOfRightMostSetBitTest {
|
||||
assertEquals(-1, IndexOfRightMostSetBit.indexOfRightMostSetBit(0));
|
||||
assertEquals(3, IndexOfRightMostSetBit.indexOfRightMostSetBit(-40));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,4 +20,4 @@ class NonRepeatingNumberFinderTest {
|
||||
int arr2[] = {12};
|
||||
assertEquals(12, NonRepeatingNumberFinder.findNonRepeatingNumber(arr2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -30,4 +30,4 @@ class NumbersDifferentSignsTest {
|
||||
void testSameSignsNegative() {
|
||||
assertFalse(NumbersDifferentSigns.differentSigns(-5, -8));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -30,4 +30,4 @@ public class BinaryToDecimalTest {
|
||||
assertEquals(262144L, BinaryToDecimal.binaryToDecimal(1000000000000000000L));
|
||||
assertEquals(524287L, BinaryToDecimal.binaryToDecimal(1111111111111111111L));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,4 +25,4 @@ public class LeftistHeapTest {
|
||||
heap.clear();
|
||||
Assertions.assertTrue(heap.isEmpty());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,4 +23,4 @@ class LinkedQueueTest {
|
||||
if (element[0]++ != integer) throw new AssertionError();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -37,4 +37,4 @@ class StrassenMatrixMultiplicationTest {
|
||||
int[][] actResult = SMM.multiply(A, B);
|
||||
assertArrayEquals(expResult, actResult);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -31,4 +31,4 @@ public class KnapsackMemoizationTest {
|
||||
int capacity = 50;
|
||||
assertEquals(220, knapsackMemoization.knapSack(capacity, weight, value, weight.length));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -95,4 +95,4 @@ public class OptimalJobSchedulingTest {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,4 +21,4 @@ class PartitionProblemTest {
|
||||
public void testIfSumOfTheArrayIsEven2() {
|
||||
assertFalse(PartitionProblem.partition(new int[] {1, 2, 3, 8}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,4 +13,4 @@ public class GrahamScanTest {
|
||||
GrahamScan graham = new GrahamScan(points);
|
||||
assertEquals(expectedResult, graham.hull().toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -98,4 +98,4 @@ class AreaTest {
|
||||
-> assertThrows(IllegalArgumentException.class, () -> Area.surfaceAreaCircle(0)),
|
||||
() -> assertThrows(IllegalArgumentException.class, () -> Area.surfaceAreaHemisphere(0)), () -> assertThrows(IllegalArgumentException.class, () -> Area.surfaceAreaCone(1, 0)), () -> assertThrows(IllegalArgumentException.class, () -> Area.surfaceAreaCone(0, 1)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,4 +14,4 @@ class DudeneyNumberTest {
|
||||
assertTrue(() -> DudeneyNumber.isDudeney(validDudeneyNumber));
|
||||
assertFalse(() -> DudeneyNumber.isDudeney(invalidDudeneyNumber));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,4 +17,4 @@ class PowerUsingRecursionTest {
|
||||
assertEquals(97.65625, PowerUsingRecursion.power(2.5, 5));
|
||||
assertEquals(81, PowerUsingRecursion.power(3, 4));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,4 +13,4 @@ class CountCharTest {
|
||||
|
||||
assertEquals(expectedValue, CountChar.CountCharacters(input));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,4 +29,4 @@ class PreemptivePrioritySchedulingTest {
|
||||
// Assert
|
||||
assertEquals(expectedGanttChart, actualGanttChart);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -60,4 +60,4 @@ class RRSchedulingTest {
|
||||
|
||||
return processDetails;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -106,4 +106,4 @@ class SJFSchedulingTest {
|
||||
a.scheduleProcesses();
|
||||
assertTrue(a.schedule.isEmpty());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -99,4 +99,4 @@ public class BreadthFirstSearchTest {
|
||||
// check path is the whole list
|
||||
assertArrayEquals(expectedPath.toArray(), bfs.getVisited().toArray());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,4 +23,4 @@ public class sortOrderAgnosticBinarySearchTest {
|
||||
int excepted = 3;
|
||||
assertEquals(excepted, ans);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -39,4 +39,4 @@ public class BeadSortTest {
|
||||
int[] expectedOutput = {1, 6, 15, 23, 23, 27, 27, 36};
|
||||
assertArrayEquals(outputArray, expectedOutput);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -45,4 +45,4 @@ public class BucketSortTest {
|
||||
int[] expectedOutput = {-36, -15, -1, 6, 23, 23, 27, 27};
|
||||
assertArrayEquals(outputArray, expectedOutput);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -59,4 +59,4 @@ class DualPivotQuickSortTest {
|
||||
String[] expected = {"ant", "apple", "boss", "cat", "dog", "eat"};
|
||||
assertArrayEquals(expected, sorted);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -83,4 +83,4 @@ class HorspoolSearchTest {
|
||||
void testFindFirstTextNull() {
|
||||
assertThrows(NullPointerException.class, () -> HorspoolSearch.findFirst("Hello", null));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user