Commit graph

15 commits

Author SHA1 Message Date
Tom
5e7e010d24
[Crate] Add rich error type (#80)
* Add rich error type with source and backtrace

Adds a rich error type that will take a backtrace and allow capturing
the source of the error. The best way to use this is with the included
helpers that will automatically capture the backtrace and convert the
source error:

```
GDRichError::packet_bad_from_into("Reason packet was bad")
```

* [Crate] Bump MSRV to 1.65.0

This is required for backtraces in rich errors.

* Remove leftover debug logging

* [Errors] Replace variant overloads with single .rich method on kind enum

This overhaul replaces the exhaustive impls of each variant as multiple
methods on the rich error type with a singular .rich() method on the
kind enum. This consumes the variant and converts it to a rich error
with a source (.into() can be used if a source is not needed).

I also took the liberty of replacing all usages with the this new method
as I saw fit (adding various error messages) and converting a few
PacketBad errors to TypeParse errors when they are the result of parse
failing.

* Fix problem with rustdoc

* Remove BadGame's owned string

* Rename GDError to GDErrorKind

* Rename GDRichError to GDError

* Remove error impl from GDErrorKind

* Fix tests not passing

* Use error context everywhere map_err is used

* Improve GDError display formatter

* Add tests for new error type
2023-08-05 12:36:48 +03:00
Tom
fb447edbc2
[Docs] Add rustdoc checks to CI and tests to pre-commit (#83) 2023-08-02 17:44:42 +03:00
Tom
a8342296d6
[CI] Improve checks (#71)
* [CI] Improve checks

- Adds .actrc so CI actions can be tested locally
- Adds testing for variants of features so changes that break feature
  sets like disabling games can be caught
- Adds more of the CI tests to pre-commit

* [CI] Add more feature sets to test

* [CI] Check github actions before comitting

Requires act: https://github.com/nektos/act

* [CI] Add caching between builds

* [CI] Add caching everywhere

* [CI] Add more feature tests

* [CI] Add YAML schemas

* [CI] Disable audit when running locally

This is needed because the audit action requires a GITHUB_TOKEN which we
don't have when running locally.

* [CI] Move clippy to own job and use action that annotates PRs

Using actions-rs/clippy-check means that PRs will problems will
automatically have the relevant lines annotated

* [CI] Don't unnecessarily cache targets for fmt
2023-07-12 23:40:10 +03:00
Tom
fb9d15f0cc
[Crate] Bump rustfmt version to 1.6.0 (#69) 2023-07-10 18:32:17 +03:00
CosminPerRam
bf8c087b94
[CI] Using recommended CI Cargo audit Github action and update serde (#70)
* [CI] Using recommended CI Github action

* [Crate] Update serde dependencies
2023-07-10 17:09:22 +03:00
CosminPerRam
9c93e40650
[CI] Pin specific rustfmt version (#57)
* [CI] Specify specific rustfmt version

* [CI] Specify platform in CI for rustfmt

* [CI] Fix cargo fmt running missing nightly version
2023-06-25 15:42:29 +03:00
CosminPerRam
08e00c64e4 [CI] Replace check by clippy 2023-06-14 15:38:08 +03:00
CosminPerRam
6486c1e17b [CI] Reorder steps again and change some steps names 2023-06-13 22:20:31 +03:00
CosminPerRam
3fd3c7aa5b [CI] Add cargo audit to CI 2023-06-13 22:16:14 +03:00
CosminPerRam
8bc05013ee [CI] Resort check and build steps so build is the first 2023-06-13 22:15:10 +03:00
Tom
b95b2abe0f
[Crate] Enforce formatting in CI (#46)
* [CI] Check formatting

* Format all files
2023-06-10 18:15:12 +03:00
CosminPerRam
bfa2c9826f [Crate] Fix github workflow ci 2023-06-06 23:34:59 +03:00
CosminPerRam
4a8ad7c3dc [Crate] Update Github workflow to confirm MSRV 2023-06-06 23:31:19 +03:00
CosminPerRam
f683c17c80 Changed name of the CI file 2022-11-25 19:56:43 +02:00
CosminPerRam
462014c8ac Renamed workflow file and edited README 2022-11-25 19:37:12 +02:00
Renamed from .github/workflows/build_and_test.yml (Browse further)