16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
# File 'lib/docopslab/dev/spell_check.rb', line 16
def generate_spellcheck_report file_path=nil
puts '📝 Generating spellcheck report from Vale output...'
manifest = DocOpsLab::Dev.load_manifest
spellcheck_config = manifest['spellcheck'] || {}
output_dir = spellcheck_config['output_dir'] || '.agent/reports/'
FileUtils.mkdir_p(output_dir)
output_file = spellcheck_config['output_file'] || nil
prompt = spellcheck_config['prompt'] || nil
unless defined?(output_file) && output_file
timestamp = Time.now.strftime('%Y%m%d_%H%M%S')
output_file = "spellcheck-#{timestamp}.yml"
end
output_path = File.join(output_dir, output_file)
vale_json = DocOpsLab::Dev.run_vale(
file_path,
'',
output_format: :json,
filter: 'DocOpsLab-Authoring.Spelling')
return false if vale_json.nil?
spelling_issues = parse_vale_json_output(vale_json)
if spelling_issues.empty?
puts '✅ No spelling issues found!'
return true
end
generate_yaml_report(spelling_issues, output_path, prompt)
puts "📄 SpellCheck report generated: #{output_path}"
puts "Found #{spelling_issues.length} spelling issues to review"
true
end
|