ara_reporting 0.2.0

Ara reporting library for Ara compiler
Documentation
# Ara Reporting

[![Actions Status](https://github.com/ara-lang/reporting/workflows/ci/badge.svg)](https://github.com/ara-lang/reporting/actions)
[![Crates.io](https://img.shields.io/crates/v/ara_reporting.svg)](https://crates.io/crates/ara_reporting)
[![Docs](https://docs.rs/ara_reporting/badge.svg)](https://docs.rs/ara_reporting/latest/ara_reporting/)

Ara reporting is an issue reporting library designed to be used within the Ara compiler.

Internally, Ara reporting uses the [codespan-reporting](https://github.com/brendanzab/codespan) library to build a report of the issues found in the code.

> **Note** If you are planning on adding more features to Ara reporting, please consider adding them to [codespan]https://github.com/brendanzab/codespan instead if possible.

## Usage

Add `ara_reporting` to your `Cargo.toml`, and you're good to go!

```toml
[dependencies]
ara_reporting = "0.2.0"
```

## Example

```rust
use ara_reporting::annotation::Annotation;
use ara_reporting::builder::CharSet;
use ara_reporting::builder::ColorChoice;
use ara_reporting::builder::ReportBuilder;
use ara_reporting::error::Error;
use ara_reporting::issue::Issue;
use ara_reporting::source::Source;
use ara_reporting::Report;

fn main() -> Result<(), Error> {
    let source = Source::inline(
        r#"
$b = match $a {
    1 => 2,
    2 => 3,
    default => "string",
};
"#,
    );

    let report = Report::new().with_issue(
        Issue::error("E0417", "`match` arms have incompatible types", 6, 61)
            .with_annotation(
                Annotation::new(26, 1).with_message("this is found to be of type `{int}`"),
            )
            .with_annotation(
                Annotation::new(38, 1).with_message("this is found to be of type `{int}`"),
            )
            .with_annotation(
                Annotation::new(56, 8).with_message("expected `{int}`, found `{string}`"),
            )
            .with_note("for more information about this error, try `ara --explain E0417`"),
    );

    let builder = ReportBuilder::new(source, report)
        .with_colors(ColorChoice::Always)
        .with_char_set(CharSet::Unicode);

    builder.print()
}
```

see [examples](examples) directory for more examples.

## License

Licensed under either of

 * Apache License, Version 2.0 ([LICENSE-APACHE]LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
 * MIT license ([LICENSE-MIT]LICENSE-MIT or http://opensource.org/licenses/MIT)

at your option.

## Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.

## Credits

* [Saif Eddin Gmati]https://github.com/azjezz
* [All contributors]https://github.com/ara-lang/reporting/graphs/contributors