Skip to content

Commit

Permalink
Merge pull request #932 from anraf1001/nwd-nnw-clang-format
Browse files Browse the repository at this point in the history
Nwd nnw - clang-format action
  • Loading branch information
arafalski authored Jun 12, 2022
2 parents 3c8b812 + e10eea9 commit 017b888
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
9 changes: 9 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Language: Cpp
BasedOnStyle: Chromium
UseTab: Never
IndentWidth: 4
TabWidth: 4
AllowShortIfStatementsOnASingleLine: Never
IndentCaseLabels: false
ColumnLimit: 0
AccessModifierOffset: -4
9 changes: 9 additions & 0 deletions .github/workflows/nwd-nnw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
6 changes: 3 additions & 3 deletions homework/nwd-nnw/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
8 changes: 3 additions & 5 deletions homework/nwd-nnw/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::tuple<int, int, int>> {
};
Expand Down Expand Up @@ -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
)
);
));

0 comments on commit 017b888

Please sign in to comment.