moved scripts to script folder

This commit is contained in:
whaffman 2025-10-09 23:13:48 +02:00
parent 4614a2d382
commit b43901de1a
9 changed files with 34 additions and 18 deletions

View File

@ -89,7 +89,7 @@ test_build: release
# Coverage targets
coverage:
@echo "Running coverage analysis..."
./coverage.sh
./scripts/coverage.sh
coverage_clean:
@echo "Cleaning coverage data..."
@ -103,5 +103,10 @@ coverage_manual:
$(CMAKE_BUILD) build_coverage
cd build_coverage && $(CMAKE_BUILD) . --target coverage
# Code formatting target
format:
@echo "Running code formatting..."
./scripts/format.sh
# Mark targets as phony
.PHONY: all release debug asan run run_release run_debug run_asan clean fclean re test test_verbose test_build coverage coverage_clean coverage_manual
.PHONY: all release debug asan run run_release run_debug run_asan clean fclean re test test_verbose test_build coverage coverage_clean coverage_manual format

View File

@ -3,7 +3,8 @@
# Don't exit on first error - we want to continue checking all files
# set -e
# Use current working directory as project root
# Change to project root directory (parent of scripts directory)
cd "$(dirname "$0")/.." || exit 1
PROJECT_ROOT="$(pwd)"
# Find the build directory - check multiple possible locations
@ -87,7 +88,7 @@ if [ ! -f "$BUILD_DIR/compile_commands.json" ]; then
fi
# Create results directory
RESULTS_DIR="$PROJECT_ROOT/iwyu_results"
RESULTS_DIR="$PROJECT_ROOT/scripts/iwyu_results"
mkdir -p "$RESULTS_DIR"
# Function to run IWYU on a single file

View File

@ -6,7 +6,7 @@
set -e # Exit on any error
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$SCRIPT_DIR"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
BUILD_DIR="$PROJECT_ROOT/build_coverage"
# Colors for output

View File

@ -5,9 +5,9 @@
set -e
# Find project root (directory containing this script)
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
RESULTS_DIR="$PROJECT_ROOT/iwyu_results"
# Find project root (parent directory of scripts)
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
RESULTS_DIR="$PROJECT_ROOT/scripts/iwyu_results"
# Colors for output
RED='\033[0;31m'

View File

@ -1,10 +1,13 @@
#!/bin/bash
./check_iwyu.sh
./fix_iwyu_auto.sh
# Change to project root directory
cd "$(dirname "$0")/.." || exit 1
./scripts/check_iwyu.sh
./scripts/fix_iwyu_auto.sh
find webserv -name "*.hpp" -o -name "*.cpp" | xargs sed -i -E 's/#include "(.*)"/#include <\1>/g'
find webserv -name "*.cpp" -o -name "*.hpp" | xargs clang-format -i
find webserv -name "*.hpp" -exec sh -c 'if ! grep -q "#pragma once" "$1"; then echo "Missing #pragma once in $1"; fi' _ {} \;
# Reorder includes to put corresponding header first
./reorder_includes.sh
./scripts/reorder_includes.sh

View File

@ -4,6 +4,9 @@
# 1. Move the corresponding .hpp include to the top of includes
# 2. Add a blank line after it (avoiding multiple blank lines)
# Change to project root directory
cd "$(dirname "$0")/.." || exit 1
find webserv -name "*.cpp" | while read -r cpp_file; do
# Get the base name without extension (e.g., "Client" from "Client.cpp")
base_name=$(basename "$cpp_file" .cpp)

View File

@ -56,6 +56,9 @@ done
echo -e "${BLUE}🧪 Webserv Test Runner${NC}"
echo "========================================"
# Change to project root directory
cd "$(dirname "$0")/.." || exit 1
# Check if we're in the right directory
if [[ ! -f "CMakeLists.txt" || ! -d "tests" ]]; then
echo -e "${RED}❌ Error: Please run this script from the webserv project root${NC}"

View File

@ -5,6 +5,9 @@
set -e # Exit on any error
# Change to project root directory
cd "$(dirname "$0")/.." || exit 1
echo "🚀 Setting up webserv development environment..."
# Detect environment

View File

@ -10,13 +10,11 @@
#include <webserv/http/HttpHeaders.hpp> // for HttpHeaders
#include <webserv/log/Log.hpp> // for LOCATION, Log
#include <functional> // for identity
#include <memory> // for unique_ptr
#include <optional> // for optional
#include <ranges> // for __find_fn, find
#include <string> // for basic_string, string, operator==
#include <utility> // for move
#include <vector> // for vector
#include <memory> // for unique_ptr
#include <optional> // for optional
#include <ranges> // for __find_fn, find
#include <string> // for basic_string, string
#include <vector> // for vector
bool Router::isMethodSupported(const std::string &method, const AConfig &config)
{