From ab9985c1ce0e4de617804ad8172cc31d51071d09 Mon Sep 17 00:00:00 2001 From: shivamdesai04 <101665374+shivamdesai04@users.noreply.github.com> Date: Sat, 28 Sep 2024 13:41:48 -0600 Subject: [PATCH] Added onboarding files --- test.cpp | 21 +++++++++++++++++++++ test.py | 18 ++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 test.cpp create mode 100644 test.py 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()