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
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
12 changes: 12 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in the repo.
* @ziobron

# Order is important. The last matching pattern has the most precedence.
# So if a pull request only touches cpp, hpp or md files, only these owners
# will be requested to review.
*.cpp @ziobron
*.hpp @ziobron
*.md @ziobron
31 changes: 31 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: STL homework

on: [push, pull_request]

jobs:
insensitive-palindrom:
runs-on: ubuntu-latest
env:
path: homework/insensitive-palindrom/build
steps:
- name: Check out code
uses: actions/checkout@master
- name: Create build directory
run: mkdir ${{ env.path }}
- name: Compile
working-directory: ${{ env.path }}
run: |
cmake ..
make
- 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/insensitive-palindrom'
52 changes: 0 additions & 52 deletions .github/workflows/module1.yml

This file was deleted.

52 changes: 0 additions & 52 deletions .github/workflows/module2.yml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/module3.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/module4.yml

This file was deleted.

55 changes: 0 additions & 55 deletions README.md

This file was deleted.

Binary file removed coders_school_logo.png
Binary file not shown.
29 changes: 29 additions & 0 deletions homework/insensitive-palindrom/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
cmake_minimum_required(VERSION 3.11.0)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

include(FetchContent)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG main # release-1.10.0
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)

# Now simply link against gtest or gtest_main as needed. Eg

project(insensitivePalindrom)
enable_testing()

add_executable(${PROJECT_NAME}-ut test.cpp palindrone.cpp) # add your cpp file here after test.cpp
# if this is problematic take a look into CMakeLists.txt files in other exercises

add_compile_options(${PROJECT_NAME}-ut -Wall -Wextra -Wconversion -pedantic -Werror)

target_link_libraries(${PROJECT_NAME}-ut gtest_main)

include(GoogleTest)
gtest_discover_tests(${PROJECT_NAME}-ut)
11 changes: 11 additions & 0 deletions homework/insensitive-palindrom/palindrone.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "palindrone.h"

bool is_palindrome(std::string s) {
s.erase(std::remove_if(s.begin(), s.end(), [](char c) {
return !std::isalnum(c);
}),
s.end());

std::transform(s.begin(), s.end(), s.begin(), [](char c) { return std::tolower(c); });
return std::equal(s.begin(), s.end(), s.rbegin(), s.rend());
}
6 changes: 6 additions & 0 deletions homework/insensitive-palindrom/palindrone.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>

bool is_palindrome(std::string s);
2 changes: 2 additions & 0 deletions homework/insensitive-palindrom/tempCodeRunnerFile.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bool temp = is_palindrome("Eva, can I see bees in a cave?");
std::cout << std::boolalpha << temp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "gtest/gtest.h"

#include "palindrone.h"
// TODO: Includes

class InsensitivePalindromFixture : public ::testing::TestWithParam<std::pair<std::string, bool>> {
Expand Down
Binary file removed logo.png
Binary file not shown.
47 changes: 0 additions & 47 deletions module1/homework/grayscaleImages/CMakeLists.txt

This file was deleted.

Loading