Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Another simple C++ script with formatting and linting issues for clang-format
// and clang-tidy.

#include <iostream>

int add(int a,
int b) { // Missing space between parameters for clang-format to catch.
return a + b; // Inconsistent spacing around operators.
}

void printSum(int a, int b) { // Formatting issue with parameters.
std::cout << "The sum of " << a << " and " << b << " is: " << add(a, b)
<< std::endl; // Missing spaces in function call.
}

int main() {
int x = 10; // No space between `=` and value.
int y = 20;
printSum(x, y); // Misformatted function call.
return 0;
}
18 changes: 18 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Another simple Python script with formatting and linting issues.


def factorial(n):
if n == 1:
return 1 # Improper indentation and return statement on the same line.
else:
return n * factorial(n - 1) # Missing spaces around operators.


def main():
num = 5 # Extra spaces around the assignment.
print(
"Factorial of", num, "is", factorial(num)
) # Missing space before the function call.


main()