Skip to content

docs: Comprehensive examples and API documentation improvements#39

Merged
nerdCopter merged 9 commits into
masterfrom
docs/clarify-multi-log-api
Dec 30, 2025
Merged

docs: Comprehensive examples and API documentation improvements#39
nerdCopter merged 9 commits into
masterfrom
docs/clarify-multi-log-api

Conversation

@nerdCopter
Copy link
Copy Markdown
Owner

@nerdCopter nerdCopter commented Dec 30, 2025

Overview

Comprehensive documentation and example improvements addressing user confusion about multi-log API usage, example organization, and feature completeness.

Changes

1. Multi-Log API Clarity

  • Added new multi_flight_export.rs example demonstrating correct parse_bbl_file_all_logs() usage
  • Updated csv_export.rs with clear warnings about first-flight-only behavior
  • Enhanced CRATE_USAGE.md with prominent warning section and flight numbering documentation
  • Added best practices for handling both single and multi-flight files

2. Documentation Consolidation

  • Removed export_demo duplication: replaced brief 3-line description with cross-reference
  • Removed csv_export duplication: replaced 12-line block with cross-reference to comprehensive section
  • Improved scannability by centralizing example documentation

3. Feature Status Corrections

  • GPS Export (gpx_export): Updated status from "⏳ Partially implemented" to "✅ Fully functional"
    • Verified: Successfully exports 833 GPS coordinates with home position, elevation, timestamps
  • Event Export (event_export): Updated status from "⏳ Partially implemented" to "✅ Fully functional"
    • Verified: Successfully exports flight events (disarm, arm, mode changes) with timestamps
  • Multi-format Examples: Updated multi_export and export_demo to "✅ Production Ready"
  • Removed misleading footnote about parser enhancements needed

4. CLI vs Library Clarification

  • Added new "CLI Tool vs Library Examples" section explaining:
    • What the bbl_parser CLI binary is (src/main.rs, part of the crate)
    • When to use CLI vs library API
    • Build/install instructions
    • Relationship between library, examples, and CLI

5. Example Consistency

  • Added status indicator to export_demo section for consistency with other examples
  • Simplified multi_flight_export.rs output logic: removed unused variable, improved readability
  • All examples now have consistent status indicators and formatting

6. Examples/README.md Updates

  • Quick start section with clear before/after patterns
  • Comprehensive API Pattern section showing correct vs incorrect usage
  • Common mistakes section highlighting the parse_bbl_file() trap
  • Updated implementation status table with accurate status indicators

Commits

  1. 6dda59b - docs: Clarify multi-log API and add multi_flight_export example
  2. 88c3d6e - docs: Remove export_demo duplication in examples/README.md
  3. 2171dc8 - docs: Remove csv_export duplication in examples/README.md
  4. b2a1cbf - docs: Clarify CLI vs Library API in examples/README.md
  5. 78d114d - docs: Correct GPS and Event export implementation status
  6. 4f519a7 - docs: Update multi_export status to fully functional
  7. abf08f0 - refactor: Simplify output logic in multi_flight_export.rs
  8. 173b480 - docs: Add status indicator to export_demo section

Testing

All examples have been tested and verified:

  • ✅ csv_export: Exports first flight correctly
  • ✅ multi_flight_export: Exports all flights with proper .01, .02, .03 suffixes
  • ✅ gpx_export: Exports 833 GPS coordinates with full metadata
  • ✅ event_export: Exports 5 flight events with timestamps
  • ✅ export_demo: Exports all formats with comprehensive output
  • ✅ multi_export: Exports all formats for multi-flight files

Benefits

  • Prevents User Error: Clear distinction between parse_bbl_file() and parse_bbl_file_all_logs()
  • Reduces Confusion: CLI vs library API usage patterns are now explicit
  • Improves Readability: Eliminated duplication, better document scannability
  • Accurate Status: Documentation reflects actual implementation completeness
  • Production Ready: All export formats confirmed working in production use

Breaking Changes

None. All changes are documentation and example improvements. No API changes.

Related Issues

Addresses the test_crate API usage issue and improves onboarding for new crate users.

Summary by CodeRabbit

  • Documentation

    • Expanded guidance on single-flight vs. multi-flight files, flight numbering, and recommended workflows.
    • Clarified export behaviors (CSV/GPX/Event) including per-flight filename suffixing and zero-padded rules when multiple flights exist.
    • Reorganized Quick Start and examples documentation for clearer API vs CLI usage and best practices.
  • Examples

    • Rewrote examples guide, added a dedicated multi-flight export example, and clarified which examples export only the first flight.

✏️ Tip: You can customize this high-level summary in your review settings.

IMPROVEMENTS:

1. New Example: multi_flight_export.rs
   - Demonstrates how to export ALL flights from a BBL file
   - Shows proper use of parse_bbl_file_all_logs()
   - Displays flight numbering and automatic suffixing

2. Updated Examples/README.md
   - Added quick-start section with usage for both single/multi-flight cases
   - Clear explanation of when to use each example
   - API pattern guide showing correct usage
   - Common mistakes section with dos/don'ts
   - Flight numbering table explaining suffixes

3. Updated csv_export.rs Comments
   - Added prominent note about multi-log handling
   - Reference to multi_flight_export example
   - Clarified that this exports only first flight

4. Enhanced CRATE_USAGE.md
   - Added warning section about parse_bbl_file() vs parse_bbl_file_all_logs()
   - Renamed sections for clarity (Single-flight, Multi-flight)
   - Best practices: Handle both cases with parse_bbl_file_all_logs()
   - New Flight Numbering section with detailed explanation
   - Suffix rules documentation
   - Production code recommendation

This addresses the issue where users might accidentally use parse_bbl_file() on multi-flight files and only export the first flight. The new example and documentation make the distinction clear.
Consolidated duplicate content:

- Removed brief 3-line description of export_demo (lines 72-77)
- Replaced with single cross-reference to the comprehensive section below
- Comprehensive section (Features, Usage, Example Output, Implementation Notes)
  remains intact at line 148+
- Anchor #export_demo-example correctly links from line 73

Improves readability and reduces redundancy while maintaining complete documentation.
Consolidated duplicate documentation:

- Removed redundant csv_export block from 'Additional Export Examples' section
- Replaced with single cross-reference to comprehensive entry in 'Available Examples'
- Anchor links correctly reference sections above
- Reduces file length by 11 lines while maintaining complete documentation

Improves readability by centralizing example documentation.
Addressed ambiguity about bbl_parser CLI tool usage:

Changes:
1. Removed confusing CLI fallback references from gpx_export and event_export
   - Deleted: 'Use CLI: bbl_parser --gps flight.BBL'
   - Deleted: 'Use CLI: bbl_parser --event flight.BBL'

2. Added new 'CLI Tool vs Library Examples' section explaining:
   - What the CLI binary is (src/main.rs in the crate)
   - When to use CLI (command-line processing, batch operations)
   - When to use library API (Rust integration, programmatic access)
   - How to build/install the CLI
   - Relationship between library, examples, and CLI

This clarifies that:
- bbl_parser CLI is part of the crate (not separate tool)
- It's a convenience wrapper on the library API
- Readers should choose based on their use case
- Examples focus on library integration patterns
Fixed inaccurate documentation:

Test Results (BTFL_KWONGKAN_10inch_0326_00_Filter.BBL):
- gpx_export: ✅ Successfully exported 833 GPS coordinates
  - Includes home position, elevation, timestamps
  - Valid GPX format with proper structure
- event_export: ✅ Successfully exported 5 events
  - Includes sync beep, flight mode, disarm, log end
  - Proper timestamp collection

Documentation Updates:
- gpx_export status: ⏳ Partial → ✅ Fully functional
- event_export status: ⏳ Partial → ✅ Fully functional
- multi_export status: ⏳ Partial → ✅ Production Ready
- export_demo status: ⏳ Partial → ✅ Production Ready
- Removed misleading footnote about parser enhancement needed
- Updated implementation status table

GPS and Event data collection are fully functional in the parser module.
No parser enhancements are needed.
- Changed multi_export status from 'Fully functional for CSV, ⏳ GPS/Event pending'
  to '✅ Fully functional - Exports all available formats'
- Aligns with verified GPS and Event export functionality
- Removed unused 'suffix' variable
- Simplified conditional output with direct if/else branches
- Clearer output messages:
  - Single flight: '✓ Exported'
  - Multiple flights: '✓ Exported as .NN.csv'
- Reduces code complexity and improves readability
- Added status line after Usage examples (line 171)
- Consistent with gpx_export, event_export, and multi_export examples
- Status: '✅ Fully functional - Exports all formats (CSV, GPX, events) with comprehensive logging'
- Improves visual consistency and clarity across all example sections
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Dec 30, 2025

📝 Walkthrough

Walkthrough

This PR updates documentation to clarify single- vs multi-flight parsing and export behavior, adds extensive guidance on log numbers and per-flight suffixing, renames usage sections, and introduces a new Rust example demonstrating exporting all flights using parse_bbl_file_all_logs and export_to_csv.

Changes

Cohort / File(s) Summary
Documentation - Core Usage Guide
CRATE_USAGE.md
Reorganized and expanded with sections on log numbers, flight suffix rules, and flight numbering; distinguishes parse_bbl_file (first log) vs parse_bbl_file_all_logs (all logs); renames fields (sample_framesframes), clarifies log_number/total_logs/total_frames, and documents export filename suffix semantics (zero-padded .NN when total_logs > 1).
Documentation - Examples Overview
examples/README.md
Substantially rewritten (reordered sections, "Quick Start" focus); clarifies single- vs multi-flight example usage, updates example statuses and code snippets to prefer all-logs APIs for multi-flight files, and adds flight-numbering guidance and CLI/library usage notes.
Examples - Single-Flight Export
examples/csv_export.rs
Updated header/comments and usage notes to explicitly state this example exports only the FIRST flight (uses parse_bbl_file()); points users to the new multi-flight example for full-log exports.
Examples - Multi-Flight Support
examples/multi_flight_export.rs
New example demonstrating reading all logs with parse_bbl_file_all_logs, iterating logs, printing per-flight metadata, and exporting each flight to CSV with proper per-flight suffixing via export_to_csv.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~13 minutes

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs: Comprehensive examples and API documentation improvements' directly summarizes the main change: documentation and examples enhancements for the bbl_parser API, with specific focus on multi-log API clarification and consolidation.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/clarify-multi-log-api

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 173b480 and 4f4d537.

📒 Files selected for processing (1)
  • examples/README.md
🧰 Additional context used
🧠 Learnings (7)
📓 Common learnings
Learnt from: nerdCopter
Repo: nerdCopter/bbl_parser PR: 0
File: :0-0
Timestamp: 2025-12-08T21:15:02.434Z
Learning: Repo nerdCopter/bbl_parser: For outside-diff review notes, prefer a compact, single-block comment with flat bullets (file:line → note), no nested <details> or admonitions; overflow should be linked via gist. Maintainer: nerdCopter.
Learnt from: nerdCopter
Repo: nerdCopter/bbl_parser PR: 0
File: :0-0
Timestamp: 2025-12-08T21:15:02.434Z
Learning: For bbl_parser reviews: nerdCopter prefers compact, single-block “outside diff” comments without nested <details> or admonitions; use flat bullets with file:line references and link a gist for overflow.
Learnt from: CR
Repo: nerdCopter/bbl_parser PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-19T21:17:26.889Z
Learning: Applies to src/lib.rs : Public API must include: `parse_bbl_file()`, `parse_bbl_bytes()`, `BBLLog`, `ExportOptions`, `export_to_csv()`, `export_to_gpx()`, `export_to_event()`, conversion utilities, parser helpers
Learnt from: CR
Repo: nerdCopter/bbl_parser PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-19T21:17:26.889Z
Learning: Applies to src/main.rs : CLI (`src/main.rs`) uses library export functions (`export_to_csv`, `export_to_gpx`, `export_to_event`) with CLI-specific status messages as thin wrapper with zero public functions
Learnt from: nerdCopter
Repo: nerdCopter/bbl_parser PR: 2
File: LICENSE_COMMERCIAL:1-4
Timestamp: 2025-08-29T19:52:05.099Z
Learning: nerdCopter prefers to avoid publishing personal information in license files for privacy and security reasons, as they are an individual maintainer rather than a company.
Learnt from: nerdCopter
Repo: nerdCopter/bbl_parser PR: 2
File: README.md:520-521
Timestamp: 2025-08-29T19:53:41.354Z
Learning: nerdCopter uses AGPL-3.0-or-later licensing for the bbl_parser project with a dual-licensing approach that includes a separate commercial license option.
Learnt from: nerdCopter
Repo: nerdCopter/bbl_parser PR: 2
File: CONTRIBUTING.md:9-14
Timestamp: 2025-08-21T20:25:45.741Z
Learning: nerdCopter prefers to keep CLA language general using "project maintainer" rather than specifying a legal entity name, as they are an individual maintainer without an associated company.
Learnt from: nerdCopter
Repo: nerdCopter/bbl_parser PR: 2
File: LICENSE_COMMERCIAL:0-0
Timestamp: 2025-08-29T20:15:04.624Z
Learning: nerdCopter prefers clear positive indicators (✅) when describing fixes rather than using ❌ symbols which can be confusing when describing what was corrected in a positive context.
📚 Learning: 2025-12-08T21:15:02.434Z
Learnt from: nerdCopter
Repo: nerdCopter/bbl_parser PR: 0
File: :0-0
Timestamp: 2025-12-08T21:15:02.434Z
Learning: Repo nerdCopter/bbl_parser: For outside-diff review notes, prefer a compact, single-block comment with flat bullets (file:line → note), no nested <details> or admonitions; overflow should be linked via gist. Maintainer: nerdCopter.

Applied to files:

  • examples/README.md
📚 Learning: 2025-12-19T21:17:26.889Z
Learnt from: CR
Repo: nerdCopter/bbl_parser PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-19T21:17:26.889Z
Learning: Applies to src/lib.rs : Public API must include: `parse_bbl_file()`, `parse_bbl_bytes()`, `BBLLog`, `ExportOptions`, `export_to_csv()`, `export_to_gpx()`, `export_to_event()`, conversion utilities, parser helpers

Applied to files:

  • examples/README.md
📚 Learning: 2025-12-19T21:17:26.889Z
Learnt from: CR
Repo: nerdCopter/bbl_parser PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-19T21:17:26.889Z
Learning: Applies to src/main.rs : CLI (`src/main.rs`) uses library export functions (`export_to_csv`, `export_to_gpx`, `export_to_event`) with CLI-specific status messages as thin wrapper with zero public functions

Applied to files:

  • examples/README.md
📚 Learning: 2025-12-19T21:17:26.889Z
Learnt from: CR
Repo: nerdCopter/bbl_parser PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-19T21:17:26.889Z
Learning: Applies to src/{lib.rs,parser/**/*.rs,export.rs} : Core logic in `src/lib.rs` with parser modules (`src/parser/`) and export functions (`src/export.rs`) shared by both library and CLI

Applied to files:

  • examples/README.md
📚 Learning: 2025-12-19T21:17:26.889Z
Learnt from: CR
Repo: nerdCopter/bbl_parser PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-19T21:17:26.889Z
Learning: Applies to src/export.rs : The CSV output must precisely match the format and header order of blackbox_decode CSV files

Applied to files:

  • examples/README.md
📚 Learning: 2025-12-19T21:17:26.889Z
Learnt from: CR
Repo: nerdCopter/bbl_parser PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-19T21:17:26.889Z
Learning: Applies to Cargo.toml : Feature flags `csv`, `cli`, `json`, `serde` control optional dependencies; default: `csv` + `cli`

Applied to files:

  • examples/README.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Build Release Binaries (windows-latest, bbl_parser-windows-x64, target/release/bbl_parser.exe)
  • GitHub Check: Build Release Binaries (ubuntu-latest, bbl_parser-linux-x64, target/release/bbl_parser)
  • GitHub Check: Build Release Binaries (macos-latest, bbl_parser-macos-x64, target/release/bbl_parser)
🔇 Additional comments (7)
examples/README.md (7)

5-15: Excellent clarity on single vs multi-flight workflows.

The Quick Start section effectively sets user expectations upfront: single-flight users reach csv_export immediately, while multi-flight scenarios are clearly separated. This reduces confusion later in the guide.


19-58: Clear API guidance with effective warnings.

The documentation effectively warns single-flight users about parse_bbl_file()'s limitation and directs them to multi_flight_export.rs. The example output (lines 43–54) with frame counts and .01/.02/.03 suffixes is concrete and helps users understand expected behavior.

Confirm the example output frame counts (1,787; 61,714; 181,554) are from actual test verification mentioned in the PR summary.


76-104: Clarify automatic suffix handling behavior.

Line 102's comment ("Library automatically handles .01, .02, .03 suffixes") is critical for users to understand, but the mechanism is unclear. When export_to_csv(&log, path, &options)? is called within the loop, does the function automatically detect it's a multi-log export and add suffixes? Or must the caller manage suffix logic separately?

Similarly, line 83 claims that a single-flight file via parse_bbl_file_all_logs() outputs flight.csv (no suffix). Verify: does export_to_csv output .01.csv instead, or truly no suffix for the single-log case?

Generate a shell script or point to the relevant code (src/export.rs) that demonstrates how export_to_csv handles suffix logic for multi-log scenarios and single-log edge cases. Expected: confirmation of whether suffixes are automatic or caller-managed.


130-143: Strong reinforcement of API best practice.

The "Common Mistakes" section effectively uses ❌/✅ symbols to make the API distinction unmissable. This is valuable given that parse_bbl_file() silently succeeds on multi-flight files (returning only the first flight), a behavior users might not notice immediately.


363-376: Clarify export function parameters for multi-flight scenarios.

The GPX and Event export function signatures show parameters 0, 1 (lines 370, 374), which appear to be flight indices and counts, but this is not documented. For users exporting multiple flights, they need to know: Are these 0-based flight indices, and how do the parameters map to the .01.csv, .02.csv suffixes documented earlier? For example, what would the calls be for flight 2 of 3?

Recommend adding a brief comment or table showing example parameter values for multi-flight export.

Confirm parameter semantics for export_to_gpx() and export_to_event() functions. Provide or verify code showing how to iterate multi-flight exports with correct parameter values.


147-240: Comprehensive export_demo documentation with concrete output.

The export_demo section effectively shows all three export formats (CSV, GPX, Event) with realistic output including frame statistics and coordinate/event counts. The example output (lines 176–216) is detailed enough to help users anticipate what to expect.


305-347: Strong addition of CLI vs Library clarity.

The new "CLI Tool vs Library Examples" section (lines 315–347) effectively positions the CLI as a convenience tool built on the library API, reducing confusion for users wondering whether to use cargo run --bin bbl_parser vs cargo run --example. The table clearly distinguishes the two code paths.

Confirm that src/main.rs indeed serves as a thin wrapper using library export functions (per learnings), and that the build/install instructions (lines 321–326) are tested and current.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
examples/README.md (1)

42-54: Minor: Add language identifier to fenced code block.

The fenced code block showing example output should specify a language identifier for proper syntax highlighting and markdown linting compliance.

Suggested fix
-```
+```text
 Flight 1/3:
   Frames: 1,787
   ✓ Exported as .01.csv

Based on learnings from static analysis hints.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ec21e39 and 173b480.

📒 Files selected for processing (4)
  • CRATE_USAGE.md
  • examples/README.md
  • examples/csv_export.rs
  • examples/multi_flight_export.rs
🧰 Additional context used
🧠 Learnings (11)
📓 Common learnings
Learnt from: nerdCopter
Repo: nerdCopter/bbl_parser PR: 0
File: :0-0
Timestamp: 2025-12-08T21:15:02.434Z
Learning: Repo nerdCopter/bbl_parser: For outside-diff review notes, prefer a compact, single-block comment with flat bullets (file:line → note), no nested <details> or admonitions; overflow should be linked via gist. Maintainer: nerdCopter.
Learnt from: nerdCopter
Repo: nerdCopter/bbl_parser PR: 0
File: :0-0
Timestamp: 2025-12-08T21:15:02.434Z
Learning: For bbl_parser reviews: nerdCopter prefers compact, single-block “outside diff” comments without nested <details> or admonitions; use flat bullets with file:line references and link a gist for overflow.
Learnt from: CR
Repo: nerdCopter/bbl_parser PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-19T21:17:26.889Z
Learning: Applies to src/lib.rs : Public API must include: `parse_bbl_file()`, `parse_bbl_bytes()`, `BBLLog`, `ExportOptions`, `export_to_csv()`, `export_to_gpx()`, `export_to_event()`, conversion utilities, parser helpers
Learnt from: nerdCopter
Repo: nerdCopter/bbl_parser PR: 2
File: LICENSE_COMMERCIAL:1-4
Timestamp: 2025-08-29T19:52:05.099Z
Learning: nerdCopter prefers to avoid publishing personal information in license files for privacy and security reasons, as they are an individual maintainer rather than a company.
Learnt from: nerdCopter
Repo: nerdCopter/bbl_parser PR: 2
File: README.md:520-521
Timestamp: 2025-08-29T19:53:41.354Z
Learning: nerdCopter uses AGPL-3.0-or-later licensing for the bbl_parser project with a dual-licensing approach that includes a separate commercial license option.
Learnt from: nerdCopter
Repo: nerdCopter/bbl_parser PR: 2
File: CONTRIBUTING.md:9-14
Timestamp: 2025-08-21T20:25:45.741Z
Learning: nerdCopter prefers to keep CLA language general using "project maintainer" rather than specifying a legal entity name, as they are an individual maintainer without an associated company.
Learnt from: nerdCopter
Repo: nerdCopter/bbl_parser PR: 2
File: LICENSE_COMMERCIAL:0-0
Timestamp: 2025-08-29T20:15:04.624Z
Learning: nerdCopter prefers clear positive indicators (✅) when describing fixes rather than using ❌ symbols which can be confusing when describing what was corrected in a positive context.
📚 Learning: 2025-12-19T21:17:26.889Z
Learnt from: CR
Repo: nerdCopter/bbl_parser PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-19T21:17:26.889Z
Learning: Applies to src/lib.rs : Public API must include: `parse_bbl_file()`, `parse_bbl_bytes()`, `BBLLog`, `ExportOptions`, `export_to_csv()`, `export_to_gpx()`, `export_to_event()`, conversion utilities, parser helpers

Applied to files:

  • examples/csv_export.rs
  • examples/multi_flight_export.rs
  • CRATE_USAGE.md
  • examples/README.md
📚 Learning: 2025-12-19T21:17:26.889Z
Learnt from: CR
Repo: nerdCopter/bbl_parser PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-19T21:17:26.889Z
Learning: Applies to src/main.rs : CLI (`src/main.rs`) uses library export functions (`export_to_csv`, `export_to_gpx`, `export_to_event`) with CLI-specific status messages as thin wrapper with zero public functions

Applied to files:

  • examples/csv_export.rs
  • examples/multi_flight_export.rs
  • CRATE_USAGE.md
  • examples/README.md
📚 Learning: 2025-12-08T21:15:02.434Z
Learnt from: nerdCopter
Repo: nerdCopter/bbl_parser PR: 0
File: :0-0
Timestamp: 2025-12-08T21:15:02.434Z
Learning: Repo nerdCopter/bbl_parser: For outside-diff review notes, prefer a compact, single-block comment with flat bullets (file:line → note), no nested <details> or admonitions; overflow should be linked via gist. Maintainer: nerdCopter.

Applied to files:

  • examples/csv_export.rs
  • CRATE_USAGE.md
📚 Learning: 2025-12-19T21:17:26.889Z
Learnt from: CR
Repo: nerdCopter/bbl_parser PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-19T21:17:26.889Z
Learning: Applies to src/export.rs : The CSV output must precisely match the format and header order of blackbox_decode CSV files

Applied to files:

  • examples/csv_export.rs
  • examples/multi_flight_export.rs
  • CRATE_USAGE.md
  • examples/README.md
📚 Learning: 2025-12-19T21:17:26.889Z
Learnt from: CR
Repo: nerdCopter/bbl_parser PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-19T21:17:26.889Z
Learning: Applies to src/{lib.rs,parser/**/*.rs,export.rs} : Core logic in `src/lib.rs` with parser modules (`src/parser/`) and export functions (`src/export.rs`) shared by both library and CLI

Applied to files:

  • examples/csv_export.rs
  • examples/multi_flight_export.rs
  • CRATE_USAGE.md
  • examples/README.md
📚 Learning: 2025-12-19T21:17:26.889Z
Learnt from: CR
Repo: nerdCopter/bbl_parser PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-19T21:17:26.889Z
Learning: Applies to src/**/*.rs : Do not remove or modify comments unless the related code is changed; only add comments that explain code functionality, no AI instructional comments

Applied to files:

  • examples/csv_export.rs
📚 Learning: 2025-12-19T21:17:26.889Z
Learnt from: CR
Repo: nerdCopter/bbl_parser PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-19T21:17:26.889Z
Learning: Applies to src/**/*.rs : BEFORE ANY CODE CHANGES: Run `cargo fmt --all -- --check` to ensure formatting compliance

Applied to files:

  • examples/csv_export.rs
📚 Learning: 2025-12-08T21:15:02.434Z
Learnt from: nerdCopter
Repo: nerdCopter/bbl_parser PR: 0
File: :0-0
Timestamp: 2025-12-08T21:15:02.434Z
Learning: For bbl_parser reviews: nerdCopter prefers compact, single-block “outside diff” comments without nested <details> or admonitions; use flat bullets with file:line references and link a gist for overflow.

Applied to files:

  • CRATE_USAGE.md
📚 Learning: 2025-08-29T19:55:43.912Z
Learnt from: nerdCopter
Repo: nerdCopter/bbl_parser PR: 2
File: README.md:0-0
Timestamp: 2025-08-29T19:55:43.912Z
Learning: nerdCopter updated the bbl_parser project license from GPL-3.0-or-later to AGPL-3.0-or-later across all repository files (Cargo.toml, LICENSE, README.md) for consistency with the dual-licensing approach that includes a commercial license option.

Applied to files:

  • CRATE_USAGE.md
📚 Learning: 2025-12-19T21:17:26.889Z
Learnt from: CR
Repo: nerdCopter/bbl_parser PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-19T21:17:26.889Z
Learning: Applies to Cargo.toml : Feature flags `csv`, `cli`, `json`, `serde` control optional dependencies; default: `csv` + `cli`

Applied to files:

  • examples/README.md
🧬 Code graph analysis (1)
examples/multi_flight_export.rs (3)
src/export.rs (1)
  • export_to_csv (191-229)
src/parser/main.rs (1)
  • parse_bbl_file_all_logs (6-25)
examples/csv_export.rs (1)
  • main (15-61)
🪛 markdownlint-cli2 (0.18.1)
examples/README.md

42-42: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Build Release Binaries (macos-latest, bbl_parser-macos-x64, target/release/bbl_parser)
  • GitHub Check: Build Release Binaries (ubuntu-latest, bbl_parser-linux-x64, target/release/bbl_parser)
  • GitHub Check: Build Release Binaries (windows-latest, bbl_parser-windows-x64, target/release/bbl_parser.exe)
🔇 Additional comments (11)
examples/csv_export.rs (2)

3-10: Excellent clarification of single-flight behavior.

The updated module documentation clearly communicates that this example exports only the first flight and guides users to the appropriate alternative for multi-flight files. This will help prevent the common mistake of using parse_bbl_file() when parse_bbl_file_all_logs() is needed.


20-21: Good user guidance in the CLI usage message.

The added notes clearly inform users about the first-flight limitation and direct them to the multi_flight_export example for handling multiple flights. This is exactly the kind of helpful inline documentation that prevents user confusion.

examples/multi_flight_export.rs (3)

1-9: Clear module documentation distinguishing this from csv_export.

The module header effectively explains the key difference between this example and csv_export.rs, making it easy for users to choose the right approach for their use case.


35-44: Good defensive programming with empty logs check.

Handling the case where no logs are found prevents confusing output and provides clear feedback to the user.


47-71: Well-structured per-flight export loop.

The iteration logic clearly displays metadata for each flight, exports with proper error propagation, and provides helpful status messages showing the flight number suffix. This makes it easy for users to understand what's happening during multi-flight export.

CRATE_USAGE.md (3)

5-14: Excellent upfront warning about multi-flight handling.

The prominent warning table at the top of the document immediately addresses the most common source of confusion - when to use which parsing function. This placement and clarity will save users from making the mistake of using parse_bbl_file() on multi-flight files.


69-107: Comprehensive multi-flight usage guidance.

The progression from basic multi-flight usage to best practice recommendations (always use parse_bbl_file_all_logs()) provides clear guidance for developers at different levels. The code examples are complete and immediately usable.


273-323: Outstanding flight numbering reference section.

The detailed tables showing different scenarios (single flight, 3 flights with different parsing approaches) combined with suffix rules make this an invaluable quick reference. The information about zero-padded 2-digit format and automatic handling by export functions removes ambiguity.

examples/README.md (3)

5-16: Excellent Quick Start section placement.

Putting the most common use cases right at the top with simple command examples makes it easy for users to get started immediately. The distinction between single-flight and multi-flight export is clear and actionable.


76-86: Clear flight numbering reference table.

The table showing different scenarios and their outputs provides a quick visual reference that complements the detailed documentation in CRATE_USAGE.md. This helps users quickly understand which function to use for their situation.


315-346: Valuable CLI vs Library distinction.

The new section clearly explains when to use the CLI binary versus the library API, along with concrete examples of installation and usage. This addresses a common point of confusion for users trying to understand the relationship between the CLI tool and the library.

- Added 'text' language identifier to multi_flight_export example output (line 42)
- Added 'text' language identifier to export_demo example output (line 176)
- Improves syntax highlighting and markdown linting compliance
- All code blocks now properly labeled: bash, rust, or text
@nerdCopter nerdCopter merged commit c923383 into master Dec 30, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant