Skip to content

Commit

Permalink
upgrade to use latest small_vectors v3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur Bać committed Mar 6, 2024
1 parent ecc061c commit b93815a
Show file tree
Hide file tree
Showing 17 changed files with 5,175 additions and 4,923 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.23)

project(stralgo
VERSION 1.1.3
VERSION 1.2.0
LANGUAGES CXX
HOMEPAGE_URL "https://github.com/arturbac/stralgo"
)
Expand Down Expand Up @@ -36,7 +36,7 @@ CPMAddPackage(
CPMAddPackage(
small_vectors
GITHUB_REPOSITORY arturbac/small_vectors
GIT_TAG v2.1.0
GIT_TAG v3.1.0
OPTIONS "SMALL_VECTORS_ENABLE_UNIT_TESTS=${STRALGO_ENABLE_UNIT_TESTS}"
)
#----------------------------------------------------------------
Expand All @@ -45,7 +45,7 @@ CPMAddPackage(
CPMAddPackage(
ut
GITHUB_REPOSITORY boost-ext/ut
GIT_TAG v1.1.9
GIT_TAG v2.0.1
)

if(NOT DEFINED CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD LESS 20 )
Expand Down
41 changes: 41 additions & 0 deletions format_sources.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

# Define directories to skip
SKIP_DIRS=("build" "cmake")

# Function to check if directory should be skipped
should_skip() {
for dir in "${SKIP_DIRS[@]}"; do
if [[ "$1" == *"/$dir/"* ]]; then
return 0 # 0 means true in bash, so skip
fi
done
return 1 # 1 means false in bash, so don't skip
}

# Main loop to find and format files
find . -type f \( -iname \*.h -o -iname \*.hpp -o -iname \*.cc -o -iname \*.c -o -iname \*.cpp \) | while read -r file; do
if should_skip "$file"; then
# echo "Skipping $file"
continue
fi

# Create a temporary file to store the original content
temp_file=$(mktemp)
cp "$file" "$temp_file"

# Format the file
clang-format -i "$file"

# Check if the file was changed by comparing it to the temporary file
if ! cmp -s "$file" "$temp_file"; then
echo "Formatted $file"
# else
# echo "$file unchanged."
fi

# Clean up the temporary file
rm "$temp_file"
done

echo "Formatting complete."
Loading

0 comments on commit b93815a

Please sign in to comment.