diff --git a/test.cpp b/test.cpp new file mode 100644 index 0000000..d7fb948 --- /dev/null +++ b/test.cpp @@ -0,0 +1,21 @@ +// Another simple C++ script with formatting and linting issues for clang-format +// and clang-tidy. + +#include + +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; +} diff --git a/test.py b/test.py new file mode 100644 index 0000000..ebbd92b --- /dev/null +++ b/test.py @@ -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()