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
53 changes: 0 additions & 53 deletions .clang-format

This file was deleted.

48 changes: 16 additions & 32 deletions .github/workflows/pr-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
types: [opened, synchronize, reopened]

jobs:
clang-format:
name: Clang Format
rust-format:
name: Rust Format
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -17,63 +17,47 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
submodules: false

- name: Install clang-format
run: |
sudo apt-get update
sudo apt-get install -y clang-format-14
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt

- name: Check changed files
id: changed-files
run: |
# Get list of changed C/C++ files (excluding submodules)
# Get list of changed Rust files (excluding third_party)
git diff --name-only origin/${{ github.base_ref }}...HEAD | \
grep -E '\.(h|hpp|c|cc|cpp)$' | \
grep -E '\.rs$' | \
grep -v '^third_party/' > changed_files.txt || true

if [ -s changed_files.txt ]; then
echo "has_changes=true" >> $GITHUB_OUTPUT
echo "Changed C/C++ files:"
echo "Changed Rust files:"
cat changed_files.txt
else
echo "has_changes=false" >> $GITHUB_OUTPUT
echo "No C/C++ files changed"
echo "No Rust files changed"
fi

- name: Check formatting of changed files
- name: Check formatting
if: steps.changed-files.outputs.has_changes == 'true'
run: |
exit_code=0
while IFS= read -r file; do
if [ -f "$file" ]; then
echo "Checking $file..."
clang-format-14 --style=file --dry-run --Werror "$file" || {
echo "::error file=$file::File is not properly formatted"
exit_code=1
}
fi
done < changed_files.txt

if [ $exit_code -ne 0 ]; then
echo ""
echo "::error::Some files are not properly formatted."
echo "To fix, run: make format"
exit 1
fi
cargo fmt --all -- --check

- name: Post PR comment on failure
if: failure() && steps.changed-files.outputs.has_changes == 'true'
uses: actions/github-script@v7
with:
script: |
const comment = `## Code Formatting Check Failed
const comment = `## Rust Format Check Failed

Some files in this PR are not properly formatted according to the project's clang-format rules.
Some Rust files in this PR are not properly formatted.

**To fix this issue:**
\`\`\`bash
make format
cargo fmt
\`\`\`

Then commit and push the changes.`;
Expand Down
116 changes: 23 additions & 93 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,109 +1,39 @@
# Build directories
build/
build-*/
build_*/
cmake-build-*/
out/
bin/
lib/
# Exception: Allow Ruby SDK lib directory
!sdk/ruby/lib/
# Rust
/target/
**/*.rs.bk
Cargo.lock

# CMake generated files
CMakeCache.txt
CMakeFiles/
cmake_install.cmake
CTestTestfile.cmake
Testing/
_deps/
# Note: We have a hand-written Makefile at root, so only ignore generated ones in subdirs
*/Makefile
# Native libraries (generated)
/native/

# Compiled object files
*.o
*.obj
*.lo
*.slo

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app
test_variant
test_variant_advanced
test_variant_extensive
test_optional
test_optional_advanced
test_optional_extensive
test_type_helpers
test_mcp_types
test_mcp_types_extended
test_mcp_type_helpers
test_compat
test_buffer
test_json
test_event_loop
test_io_socket_handle
test_address
test_socket
test_socket_interface
test_socket_option

# IDE specific files
# IDE
.vscode/
.idea/
*.swp
*.swo
*~
.DS_Store

# Debug files
*.dSYM/
*.su
*.idb
*.pdb

# Dependency directories
node_modules/
vendor/

# Coverage files
*.gcov
*.gcda
*.gcno
coverage/
*.info
# OS
.DS_Store
Thumbs.db

# Documentation
docs/html/
docs/latex/
doxygen/
# Build artifacts
*.o
*.so
*.dylib
*.dll
*.a

# Temporary files
*.tmp
*.temp
*.log

# Python cache (if using Python scripts)
__pycache__/
*.py[cod]
*$py.class
# Coverage
*.gcov
*.gcda
*.gcno
coverage/

# OS generated files
Thumbs.db
Desktop.ini
# Node modules (for example servers)
node_modules/
7 changes: 3 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[submodule "third_party/gopher-mcp"]
path = third_party/gopher-mcp
url = https://github.com/GopherSecurity/gopher-mcp.git
branch = main
[submodule "third_party/gopher-orch"]
path = third_party/gopher-orch
url = https://github.com/GopherSecurity/gopher-orch.git
Loading
Loading