Skip to content

Commit a2f90fb

Browse files
authored
Merge branch 'master' into feat-implement-heartbeat
2 parents c978bf8 + 675362c commit a2f90fb

File tree

97 files changed

+1145
-559
lines changed

Some content is hidden

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

97 files changed

+1145
-559
lines changed

.github/scripts/max-line-length.sh

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/bash
2+
3+
# Check if all required arguments are provided
4+
if [ "$#" -ne 3 ]; then
5+
echo "Usage: $0 <folder_path> <max_line_length> <file_globs>"
6+
exit 1
7+
fi
8+
9+
folder_path="$1"
10+
max_length="$2"
11+
file_globs="$3"
12+
13+
# Function to get relative path
14+
get_relative_path() {
15+
local path="$1"
16+
local base="$(pwd)"
17+
echo "${path#$base/}"
18+
}
19+
20+
# Initialize a flag to check if any lines exceed the max length
21+
found_lines=0
22+
23+
# Convert comma-separated globs to an array
24+
IFS=',' read -ra glob_array <<< "$file_globs"
25+
26+
# Use find to get all files matching the glob patterns
27+
for glob in "${glob_array[@]}"; do
28+
while IFS= read -r -d '' file; do
29+
# Get the relative path
30+
relative_path=$(get_relative_path "$file")
31+
32+
# Use awk to process each file
33+
awk -v max="$max_length" -v file="$relative_path" '
34+
length($0) > max {
35+
print file ":" NR
36+
found = 1
37+
exit 1
38+
}
39+
END {
40+
exit found
41+
}' "$file"
42+
43+
# Check awk's exit status
44+
if [ $? -eq 1 ]; then
45+
found_lines=1
46+
fi
47+
done < <(find "$folder_path" -type f -name "$glob" -print0)
48+
done
49+
50+
# Exit with appropriate code
51+
if [ $found_lines -eq 0 ]; then
52+
echo "All lines are within the $max_length character limit."
53+
exit 0
54+
else
55+
echo "Some lines exceedded the $max_length character limit."
56+
exit 1
57+
fi

.github/workflows/tests.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
php-version: ['8.2']
15+
php-version: ['8.3']
1616
sdk: [
1717
Android5Java17,
1818
Android14Java17,
@@ -101,3 +101,16 @@ jobs:
101101

102102
- name: Lint
103103
run: composer lint
104+
105+
max-line-length:
106+
runs-on: ubuntu-latest
107+
108+
steps:
109+
- name: Checkout code
110+
uses: actions/checkout@v4
111+
112+
- name: Make script executable
113+
run: chmod +x ./.github/scripts/max-line-length.sh
114+
115+
- name: Check max lines
116+
run: ./.github/scripts/max-line-length.sh . 1200 "*.twig"

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ docker run --rm -v $(pwd):$(pwd):rw -w $(pwd) -v /var/run/docker.sock:/var/run/d
262262
* **description** -> Description of Appwrite SDK
263263
* **namespace** -> SDK Namespace
264264
* **version** -> SDK Version
265-
* **endpoint** -> Default Endpoint (example: "https://appwrite.io/v1")
266-
* **host** -> Default Host (example: "appwrite.io")
265+
* **endpoint** -> Default Endpoint (example: "https://cloud.appwrite.io/v1")
266+
* **host** -> Default Host (example: "cloud.appwrite.io")
267267
* **basePath** -> Default Path to API (example: "/v1")
268268
* **licenseName** -> Name of license for SDK
269269
* **licenseURL** -> URL to SDK license

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@
2626
"psr-4": {"Tests\\": "tests"}
2727
},
2828
"require": {
29-
"php": ">=8.0",
29+
"php": ">=8.3",
3030
"ext-curl": "*",
3131
"ext-mbstring": "*",
3232
"ext-json": "*",
33-
"twig/twig": "v3.8.*",
33+
"twig/twig": "3.14.*",
3434
"matthiasmullie/minify": "1.3.*"
3535
},
3636
"require-dev": {
37-
"phpunit/phpunit": "10.5.*",
38-
"brianium/paratest": "v7.4.*",
39-
"squizlabs/php_codesniffer": "3.9.*"
37+
"phpunit/phpunit": "11.*",
38+
"brianium/paratest": "7.*",
39+
"squizlabs/php_codesniffer": "3.*"
4040
},
4141
"platform": {
4242
"php": "8.2"

0 commit comments

Comments
 (0)