diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..c7b6b950 --- /dev/null +++ b/.clang-format @@ -0,0 +1,9 @@ +Language: Cpp +BasedOnStyle: Chromium +UseTab: Never +IndentWidth: 4 +TabWidth: 4 +AllowShortIfStatementsOnASingleLine: Never +IndentCaseLabels: false +ColumnLimit: 0 +AccessModifierOffset: -4 diff --git a/.github/workflows/nwd-nnw.yml b/.github/workflows/nwd-nnw.yml index 7be6409e..3e0dea49 100644 --- a/.github/workflows/nwd-nnw.yml +++ b/.github/workflows/nwd-nnw.yml @@ -23,3 +23,12 @@ jobs: - name: Run tests working-directory: ${{ env.path }} run: ctest -V + + formatting_check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Run clang-format style check + uses: coders-school/github-actions/clang-format-check@main + with: + check_path: 'homework/nwd-nnw' diff --git a/homework/nwd-nnw/main.cpp b/homework/nwd-nnw/main.cpp index d477c3d3..d4eb70e4 100644 --- a/homework/nwd-nnw/main.cpp +++ b/homework/nwd-nnw/main.cpp @@ -2,8 +2,8 @@ #include "nwdNww.hpp" int main() { - std::cout << "NWW(255, 15) = " << NWW(255, 15) << "\n"; - std::cout << "NWD(255, 15) = " << NWD(255, 15) << "\n"; + std::cout << "NWW(255, 15) = " << NWW(255, 15) << "\n"; + std::cout << "NWD(255, 15) = " << NWD(255, 15) << "\n"; - return 0; + return 0; } diff --git a/homework/nwd-nnw/test.cpp b/homework/nwd-nnw/test.cpp index e6267f4d..bc1b86cd 100644 --- a/homework/nwd-nnw/test.cpp +++ b/homework/nwd-nnw/test.cpp @@ -35,8 +35,7 @@ INSTANTIATE_TEST_SUITE_P( std::make_tuple(10, -2, 2) // results based on implementation of std::gcm - ) -); + )); class NWWFixture : public ::testing::TestWithParam> { }; @@ -68,7 +67,6 @@ INSTANTIATE_TEST_SUITE_P( std::make_tuple(-1, -1, 1), std::make_tuple(-10, -10, 10), std::make_tuple(-10, -2, 10) - + // based on implementation of std::lcm - ) -); \ No newline at end of file + ));