Skip to content

Conversation

@RAprogramm
Copy link
Owner

@RAprogramm RAprogramm commented Jan 23, 2026

No description provided.

Adds rich diagnostic capabilities inspired by compiler diagnostics:
- Hint: contextual advice explaining errors
- Suggestion: actionable fixes with optional commands
- DocLink: documentation URLs
- DiagnosticVisibility: dev/staging/prod filtering
- Colored output in Local mode
- Zero-cost when unused (Option<Box<Diagnostics>>)
Add a CLI tool to help Rust learners understand compiler errors:
- `masterror check` - runs cargo check with friendly explanations
- `masterror explain E0382` - explains specific error codes
- `masterror list` - lists known error codes by category

Features:
- Multi-language support (en, ru)
- Colored terminal output with NO_COLOR support
- Knowledge base for common errors (E0382, E0308, E0502, E0499, E0106, E0597)
- Direct links to official Rust documentation
Example project with intentional Rust errors (E0382, E0502, E0499)
to test masterror-cli functionality.

Excluded from workspace to avoid CI failures on intentional errors.
- Refactor into modules: commands, knowledge, locale, output, parser, sections
- Add multi-language support (en, ru, ko) as cargo features
- Add display section toggles (why, fix, link, translation) as features
- Add show-original feature to optionally display compiler output
- Translate full compiler error messages for non-English locales
- Add pre-commit checks: actionlint, no_std compatibility
- Add cargo-masterror binary for `cargo masterror` usage
- Add PKGBUILD and .SRCINFO for AUR distribution
- Add errors module with 6 categories: Ownership, Borrowing, Lifetimes, Types, Traits, Resolution
- Add raprogramm module with 15 best practices (RA001-RA015) from RustManifest
- Add practice command to list and show best practices
- Extend explain command to handle both E* and RA* codes
- Remove legacy knowledge.rs, use LocalizedText for i18n
- Unify output formatting for errors and practices
- Expand cli-test-errors example with more error cases
- Remove masterror-cli from workspace
- Remove examples/cli-test-errors
- Add link to https://github.com/RAprogramm/masterror-cli in README
RAprogramm and others added 9 commits January 24, 2026 11:41
- masterror-knowledge: compiler error explanations database
  - 31 rustc errors (E0xxx) with translations (en/ru/ko)
  - 15 best practices (RA001-RA015)
  - i18n system with zero-allocation static strings

- masterror-cli: cargo subcommand for error explanations
  - `cargo masterror check` - check with explanations
  - `masterror explain E0502` - explain specific error
  - `masterror init` - interactive setup with first-run detection
  - Layered config: CLI args > env > .masterror.toml > global

- Feature `knowledge` in masterror re-exports the knowledge crate
- Add changes job with dorny/paths-filter for file change detection
- Compute dependency graph: template→derive→masterror, knowledge→cli
- Skip jobs when no relevant changes detected
- Add masterror-knowledge and masterror-cli to CRATES publish list
- Update release workflow to use $CRATES variable
- Fix no-std tests to only check masterror crate
- Add Step Summary with change detection table
- Fix rustdoc warning for private InlineVec link
- constructors.rs: new, with, bare
- modifiers.rs: with_code, with_retry_after_secs, with_www_authenticate, redactable
- metadata.rs: with_field, with_fields, redact_field, with_metadata
- context.rs: with_context, with_source, with_source_arc, with_backtrace
- details.rs: with_details_json, with_details, with_details_text
- diagnostics.rs: with_hint, with_suggestion, with_docs, with_related_code
- tests.rs: comprehensive tests for all builder methods (42 tests)

Also fix doctest in masterror-knowledge using correct crate name
- mod.rs: module exports and public interface
- mode.rs: DisplayMode enum and detection
- helpers.rs: write_json_escaped, write_metadata_value
- prod.rs: production JSON formatting
- local.rs: human-readable local/dev formatting
- staging.rs: staging JSON with context
- tests.rs: 49 comprehensive display tests
- mod.rs: module documentation and style re-export
- std_style.rs: color styling with owo_colors (std feature)
- nostd_style.rs: passthrough styling for no-std
- tests.rs: 23 comprehensive tests for both variants
- Add tests for hints, suggestions, doc links, related codes in local format
- Improve local.rs coverage from 46% to 92%
- Note: env-based mode detection tests omitted due to #![deny(unsafe_code)]
- Add README.md for masterror-knowledge with learning curve image
- Add masterror-knowledge to workspace crates table
- Update masterror-cli description with install instructions
- Add CLI links to Russian and Korean READMEs
Add comprehensive tests for:
- inline_vec: all storage variants, iterators, mutations
- metadata: field types, redaction, serialization
- app_code: hash, equality, parsing edge cases
- kind: all variants for http_status and label
- result_ext: context preservation, error wrapping
- response/problem_json: metadata sanitization, redaction
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.

2 participants