Skip to content

Commit e90b7d9

Browse files
Jonathan D.A. Jewellclaude
andcommitted
feat: complete git-seo integration (100%)
Wired up GitSeoAnalyzer into glambot audit pipeline with configuration options for enable/disable and auto-apply behavior. Changes: - src/config/mod.rs: Added git-seo config options to SeoConfig - enable_git_seo: Option<bool> (default: true) - enable_auto_apply: Option<bool> (default: false for safety) - src/main.rs: Integrated GitSeoAnalyzer into handle_audit() - Runs as fifth analyzer after machine analyzer - Respects config.seo.enable_git_seo flag - Gracefully handles git-seo unavailability (doesn't fail audit) - Results populated in AuditResult.git_seo field Configuration example: ```yaml seo: enable_git_seo: true enable_auto_apply: false # Manual approval required ``` Integration flow: 1. glambot audit runs all 5 analyzers (visual, accessibility, seo, machine, git-seo) 2. git-seo analyzer shells out to git-seo CLI 3. Parses JSON report, converts to glambot findings 4. Findings included in overall error/warning counts 5. Can block release if SEO score critically low Requirements: - git-seo CLI installed (https://github.com/hyperpolymath/git-seo) - Git remote configured (origin) - GITHUB_TOKEN for API analysis (optional but recommended) Status: Glambot ↔ Git-SEO integration COMPLETE (100%) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 239f6e9 commit e90b7d9

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

src/config/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ pub struct SeoConfig {
4545
pub require_opengraph: bool,
4646
pub check_titles: bool,
4747
pub check_descriptions: bool,
48+
/// Enable git-seo integration for comprehensive forge-based SEO analysis
49+
pub enable_git_seo: Option<bool>,
50+
/// Enable automatic application of git-seo fixes (requires GITHUB_TOKEN)
51+
pub enable_auto_apply: Option<bool>,
4852
}
4953

5054
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -104,6 +108,8 @@ impl Default for SeoConfig {
104108
require_opengraph: false,
105109
check_titles: true,
106110
check_descriptions: true,
111+
enable_git_seo: Some(true), // Enable by default
112+
enable_auto_apply: Some(false), // Safety: manual by default
107113
}
108114
}
109115
}

src/main.rs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,9 @@ fn handle_show(config: &config::Config) -> ExitCode {
192192

193193
fn handle_audit(path: &PathBuf, config: &config::Config, strict: bool, format: &str) -> ExitCode {
194194
use crate::analyzers::{
195-
accessibility::AccessibilityAnalyzer, machine::MachineAnalyzer, seo::SeoAnalyzer,
196-
visual::VisualAnalyzer, Analyzer, AuditResult,
195+
accessibility::AccessibilityAnalyzer, git_seo_integration::GitSeoAnalyzer,
196+
machine::MachineAnalyzer, seo::SeoAnalyzer, visual::VisualAnalyzer, Analyzer,
197+
AuditResult,
197198
};
198199

199200
let mut result = AuditResult::default();
@@ -235,6 +236,19 @@ fn handle_audit(path: &PathBuf, config: &config::Config, strict: bool, format: &
235236
}
236237
};
237238

239+
// Run Git-SEO integration if enabled
240+
if config.seo.enable_git_seo.unwrap_or(true) {
241+
let git_seo = GitSeoAnalyzer::default();
242+
result.git_seo = match git_seo.analyze(path, config) {
243+
Ok(r) => r,
244+
Err(e) => {
245+
eprintln!("Git-SEO analysis error: {}", e);
246+
// Don't fail if git-seo is unavailable, just skip
247+
Default::default()
248+
}
249+
};
250+
}
251+
238252
// Output results
239253
if format == "json" {
240254
match serde_json::to_string_pretty(&result) {

0 commit comments

Comments
 (0)