Commit graph

15 commits

Author SHA1 Message Date
Cain
79fc1db14c fix(MSRV): update to 1.85.1 across the project 2026-02-22 18:19:48 +00:00
Cain
080f327ab6
Maintenance: dep updates and clippy fixs (#243)
* chore(deps): update crc32fast to v1.5

* chore(deps): update ureq to v2.12

* chore(deps): update phf to v0.13

* chore(deps): update clap to v4.5

* chore(deps): update lazy_static to v1.5

* chore(deps): update thiserror to v2.0.16

* chore(deps): update clap to v4.5

* chore(deps): update bson to v2.15

* chore(deps): update base64 to v0.22

* chore(deps): update quick-xml to v0.38

* chore(deps): update webbrowser to v1.0

* chore(clippy): fix a load of "variables can be used directly"

* chore(ci): update MSRV toolchain to 1.82.0

* chore(pre-commit): update MSRV to 1.82.0

* chore(README): update Minimum Supported Rust Version to 1.82.0

* chore(VERSIONS): update MSRV to 1.82.0

* chore(cli): bump version to 0.4.0 and update MSRV to 1.82.0

* chore(release): bump version to 0.8.0 and update MSRV to 1.82.0
2025-08-25 12:52:54 +01:00
Cain
e87bde53e7 chore(nightly): bump to nightly-2025-04-19 as the other toolchain is 2 years old 2025-04-20 23:11:35 +01:00
Cain
4c5ffde2e5 chore(msrv): bump to 1.81.0 2025-04-20 22:44:19 +01:00
Cain
961f57d6ec chore(msrv): bump to 1.71.1 2024-11-26 13:50:01 +00:00
Tom
32dd486632
fix: various crate/clippy/ci changes (#181)
* crate: Set default binary to gamedig-cli

* crate: Fix bad no-default-features option on gamedig-id dependency

* ci: Run tests when Cargo.toml changes

* id-tests: Clippy fixes
2024-01-18 15:34:05 +02:00
Tom
b3a29b15b1
[CI] Improvement and fixes (#161)
* protocols: Fix building without the "games" feature

* crate/lib: Add required features for examples

This prevents cargo from running the examples if the required features
aren't enabled.

* ci: Run if ANY Cargo.toml files are changed

* ci: Make sure to run unit tests

* ci: Separate checks for library and CLI

* ci: Add slightly better comments

* ci: Only run deeper tests for CLI or LIB when their files were changed

* ci: Improve act arguments for testing actions locally

* ci: Fix pre-commit not running tests

* ci: Only update shared cache after the initial build

* ci: Make sure that rustup downloads get cached

* tidy: Clean up file formatting

* ci: Fix issue with audit
2023-11-25 00:34:26 +02:00
Douile
d34d615784
[CI] Update CI to work with workspaces 2023-10-18 00:29:21 +01:00
Tom
6c1fdb1159
[Generic] Add struct for all extra request settings (#93)
* [Generic] Add struct for all extra request settings

Adds a new struct `ExtraRequestSettings` that contains all possible
extra settings for all protocols, and can be implicitly converted with
`.into()` into each protocol's extra settings type.

This is then used in a new query method
`query_with_timeout_and_extra_settings()` that passes the object on to
the selected protocol.

This also updates the generic example to set some of these generic
settings so that it can be used for certain queries like
"mc.hypixel.net".

* [Minecraft] Add `request_settings` parameter to auto query

This allows generic queries to pass through request settings when using
the `mc` game so that servers like `mc.hypixel.net` will still work when
using auto query.

* Fix generic examples tests (and enable example tests in pre-commit)
2023-09-05 01:13:12 +03:00
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
Tom
bf14ecb4a4
[Crate] Add documentation for where versions need to be updated (#58)
VERSIONS.md tells you what the current versions for things like MSRV is
and which files you need to update if you change it.

Also fixes the incorrect:
- MSRV in README.md
- nightly version in .pre-commit-config.yaml
2023-06-25 16:02:25 +03:00
Tom
89fbd81331
[Crate] Add clippy and rustfmt pre-commit hooks (#50)
These hooks can be installed using [pre-commit], with:
"pre-commit install". Once installed they will prevent you from
committing if the staged code has clippy warnings or hasn't been
formatted. You can skip the pre-commit checks by adding the "-n" flag to
your git commit command.

The hooks also require rustup as the nightly versions of rustfmt and
clippy are used.

[pre-commit]: https://pre-commit.com/
2023-06-25 14:41:20 +03:00