Skip to content
Merged
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
154 changes: 154 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,23 @@ tree-sitter-scala = "0.24"
tree-sitter-go = "0.23"
tree-sitter-cpp = "0.23"
tree-sitter-ruby = "0.23"
# Phase 1 - New Tree-sitter language support
tree-sitter-c-sharp = "0.23.1"
tree-sitter-c = "0.24.1"
tree-sitter-php = "0.24.2"
tree-sitter-swift = "0.7.1"
tree-sitter-kotlin-ng = "1.1.0"
tree-sitter-dart = "0.0.4"
tree-sitter-yaml = "0.7.2"
# tree-sitter-toml = "0.20.0" # Replaced with devgen-tree-sitter-toml
devgen-tree-sitter-toml = "0.21.0"
tree-sitter-bash = "0.25.0"
tree-sitter-html = "0.23.2"
tree-sitter-json = "0.24.8"
tree-sitter-sequel = "0.3.11"
# tree-sitter-markdown = "0.7.1" # Replaced with tree-sitter-md
tree-sitter-toml-ng = "0.7.0"
tree-sitter-powershell = "0.25.9"
url = { version = "2.5.4", features = ["serde"] }
backon = "1.5.2"
eserde = "0.1.7"
Expand Down
15 changes: 15 additions & 0 deletions crates/forge_services/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ tree-sitter-scala.workspace = true
tree-sitter-go.workspace = true
tree-sitter-cpp.workspace = true
tree-sitter-ruby.workspace = true
# Phase 1 - New Tree-sitter language support
tree-sitter-c-sharp.workspace = true
tree-sitter-c.workspace = true
tree-sitter-php.workspace = true
tree-sitter-swift.workspace = true
tree-sitter-kotlin-ng.workspace = true
tree-sitter-dart.workspace = true
tree-sitter-yaml.workspace = true
tree-sitter-toml-ng.workspace = true
tree-sitter-bash.workspace = true
tree-sitter-html.workspace = true
tree-sitter-json.workspace = true
tree-sitter-sequel.workspace = true
tree-sitter-md = { version = "0.5.1" } # Alternative for tree-sitter-markdown
tree-sitter-powershell.workspace = true
rust-embed.workspace = true
base64.workspace = true
strum_macros.workspace = true
Expand Down
61 changes: 61 additions & 0 deletions crates/forge_services/src/tool_services/syn/lang/bash/invalid.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/bin/bash

# Invalid bash script with syntax errors
set -euo pipefail

# Configuration
BACKUP_DIR="/backup"
SOURCE_DIR="/data"
TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
LOG_FILE="/var/log/backup.log"

# Function to log messages
log() {
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $1" | tee -a "$LOG_FILE"
}

# Function to handle errors
handle_error() {
log "ERROR: Backup failed on line $1"
cleanup
exit 1
}

# Cleanup function
cleanup() {
log "Performing cleanup..."
# Remove any temporary files

# Missing closing brace for cleanup function

# Set error trap
trap 'handle_error $LINENO' ERR

# Main backup logic
log "Starting backup process"

if [[ ! -d "$SOURCE_DIR" ]]; then
log "ERROR: Source directory $SOURCE_DIR does not exist"
exit 1
fi

if [[ ! -d "$BACKUP_DIR" ]]; then
log "Creating backup directory $BACKUP_DIR"
mkdir -p "$BACKUP_DIR"
fi

BACKUP_FILE="$BACKUP_DIR/backup_$TIMESTAMP.tar.gz"

log "Creating backup: $BACKUP_FILE"
tar -czf "$BACKUP_FILE" -C "$(dirname "$SOURCE_DIR")" "$(basename "$SOURCE_DIR")"

if [[ $? -eq 0 ]]; then
log "Backup completed successfully"
log "Backup size: $(du -h "$BACKUP_FILE" | cut -f1)"
else
log "ERROR: Backup failed"
exit 1
fi

# Missing closing quotes and invalid syntax
echo "Unclosed string
59 changes: 59 additions & 0 deletions crates/forge_services/src/tool_services/syn/lang/bash/valid.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/bin/bash

# Backup script with error handling
set -euo pipefail

# Configuration
BACKUP_DIR="/backup"
SOURCE_DIR="/data"
TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
LOG_FILE="/var/log/backup.log"

# Function to log messages
log() {
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $1" | tee -a "$LOG_FILE"
}

# Function to handle errors
handle_error() {
log "ERROR: Backup failed on line $1"
cleanup
exit 1
}

# Cleanup function
cleanup() {
log "Performing cleanup..."
# Remove any temporary files
}

# Set error trap
trap 'handle_error $LINENO' ERR

# Main backup logic
log "Starting backup process"

if [[ ! -d "$SOURCE_DIR" ]]; then
log "ERROR: Source directory $SOURCE_DIR does not exist"
exit 1
fi

if [[ ! -d "$BACKUP_DIR" ]]; then
log "Creating backup directory $BACKUP_DIR"
mkdir -p "$BACKUP_DIR"
fi

BACKUP_FILE="$BACKUP_DIR/backup_$TIMESTAMP.tar.gz"

log "Creating backup: $BACKUP_FILE"
tar -czf "$BACKUP_FILE" -C "$(dirname "$SOURCE_DIR")" "$(basename "$SOURCE_DIR")"

if [[ $? -eq 0 ]]; then
log "Backup completed successfully"
log "Backup size: $(du -h "$BACKUP_FILE" | cut -f1)"
else
log "ERROR: Backup failed"
exit 1
fi

log "Backup process completed"
Loading
Loading