Skip to content

Commit 052d59d

Browse files
Copilotandimarek
andcommitted
Rename Windows-incompatible files, split large file, and add pre-commit hook
Co-authored-by: andimarek <1706744+andimarek@users.noreply.github.com>
1 parent d62a992 commit 052d59d

File tree

248 files changed

+106326
-106172
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

248 files changed

+106326
-106172
lines changed

.githooks/pre-commit

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#!/bin/bash
2+
3+
# Pre-commit hook to enforce Windows compatibility and file size limits
4+
# This hook prevents commits that would fail on Windows systems or that contain overly large files
5+
6+
set -e
7+
8+
# ANSI color codes for better output readability
9+
RED='\033[0;31m'
10+
YELLOW='\033[1;33m'
11+
NC='\033[0m' # No Color
12+
13+
# Track if we found any errors
14+
ERRORS_FOUND=0
15+
16+
echo "Running pre-commit checks..."
17+
18+
# Check 1: Windows-incompatible filenames
19+
echo " Checking for Windows-incompatible filenames..."
20+
21+
# Windows reserved characters: < > : " | ? * \
22+
# Note: We escape the backslash in the regex pattern
23+
INVALID_CHARS='[<>:"|?*\\]'
24+
25+
# Get list of staged files
26+
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACR)
27+
28+
if [ -n "$STAGED_FILES" ]; then
29+
# Check each staged file for invalid characters
30+
INVALID_FILES=$(echo "$STAGED_FILES" | grep -E "$INVALID_CHARS" || true)
31+
32+
if [ -n "$INVALID_FILES" ]; then
33+
echo -e "${RED}Error: The following files have Windows-incompatible characters in their names:${NC}"
34+
echo "$INVALID_FILES" | while read -r file; do
35+
echo " - $file"
36+
done
37+
echo -e "${YELLOW}Please rename these files to remove characters: < > : \" | ? * \\${NC}"
38+
echo -e "${YELLOW}For ISO timestamps, replace colons with hyphens (e.g., 08:40:24 -> 08-40-24)${NC}"
39+
ERRORS_FOUND=1
40+
fi
41+
fi
42+
43+
# Check 2: Files larger than 10MB
44+
echo " Checking for files larger than 10MB..."
45+
46+
MAX_SIZE=$((10 * 1024 * 1024)) # 10 MB in bytes
47+
LARGE_FILES=""
48+
49+
if [ -n "$STAGED_FILES" ]; then
50+
while IFS= read -r file; do
51+
if [ -f "$file" ]; then
52+
size=$(stat -c%s "$file" 2>/dev/null || stat -f%z "$file" 2>/dev/null || echo 0)
53+
if [ "$size" -gt "$MAX_SIZE" ]; then
54+
# Format size in human-readable format
55+
size_mb=$(echo "scale=2; $size / 1024 / 1024" | bc)
56+
LARGE_FILES="${LARGE_FILES} - $file (${size_mb} MB)\n"
57+
fi
58+
fi
59+
done <<< "$STAGED_FILES"
60+
fi
61+
62+
if [ -n "$LARGE_FILES" ]; then
63+
echo -e "${RED}Error: The following files exceed 10MB:${NC}"
64+
echo -e "$LARGE_FILES"
65+
echo -e "${YELLOW}Please consider one of these options:${NC}"
66+
echo -e "${YELLOW} 1. Split the file into smaller parts with suffixes .part1, .part2, etc.${NC}"
67+
echo -e "${YELLOW} 2. Use Git Large File Storage (Git LFS): https://git-lfs.github.com/${NC}"
68+
echo -e "${YELLOW} 3. Remove unnecessary content from the file${NC}"
69+
ERRORS_FOUND=1
70+
fi
71+
72+
# Exit with error if any checks failed
73+
if [ "$ERRORS_FOUND" -eq 1 ]; then
74+
echo -e "${RED}Pre-commit checks failed. Please fix the issues above and try again.${NC}"
75+
exit 1
76+
fi
77+
78+
echo " All pre-commit checks passed!"
79+
exit 0

CONTRIBUTING.md

Lines changed: 20 additions & 0 deletions

performance-results/2024-11-28T01:53:48Z-1d50c655aaf1a907b65f39e2eba310f3463ba5d5-jdk17.json renamed to performance-results/2024-11-28T01-53-48Z-1d50c655aaf1a907b65f39e2eba310f3463ba5d5-jdk17.json

File renamed without changes.

performance-results/2024-11-28T03:56:43Z-a3fcfcb843b2104f40e75940cea4ed03e6de12c0-jdk17.json renamed to performance-results/2024-11-28T03-56-43Z-a3fcfcb843b2104f40e75940cea4ed03e6de12c0-jdk17.json

File renamed without changes.

performance-results/2024-12-03T01:09:26Z-9d6e31e367f7b2929dd393a694dc05a0c5bb6e1a-jdk17.json renamed to performance-results/2024-12-03T01-09-26Z-9d6e31e367f7b2929dd393a694dc05a0c5bb6e1a-jdk17.json

File renamed without changes.

performance-results/2024-12-04T02:33:30Z-3e5c77ba3f27de559a65c42684fc7deb9dead263-jdk17.json renamed to performance-results/2024-12-04T02-33-30Z-3e5c77ba3f27de559a65c42684fc7deb9dead263-jdk17.json

File renamed without changes.

performance-results/2024-12-05T21:56:29Z-08cf1702ce0c96ee0ed414ee8085a75696bc6cae-jdk17.json renamed to performance-results/2024-12-05T21-56-29Z-08cf1702ce0c96ee0ed414ee8085a75696bc6cae-jdk17.json

File renamed without changes.

performance-results/2024-12-08T08:18:55Z-3d46b3737bf4f0c617425af4c63036a1336a7423-jdk17.json renamed to performance-results/2024-12-08T08-18-55Z-3d46b3737bf4f0c617425af4c63036a1336a7423-jdk17.json

File renamed without changes.

performance-results/2024-12-08T22:54:25Z-46c03234896e2ffad02a5dbf704a721ea0717c67-jdk17.json renamed to performance-results/2024-12-08T22-54-25Z-46c03234896e2ffad02a5dbf704a721ea0717c67-jdk17.json

File renamed without changes.

performance-results/2024-12-09T02:45:13Z-35760dc9e50dc3ce35a046a5b272eda696c870d5-jdk17.json renamed to performance-results/2024-12-09T02-45-13Z-35760dc9e50dc3ce35a046a5b272eda696c870d5-jdk17.json

File renamed without changes.

0 commit comments

Comments
 (0)