rust-gamedig/.pre-commit-config.yaml
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

53 lines
1.7 KiB
YAML

# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: local
hooks:
- id: clippy
name: Check clippy
language: system
files: '[.]rs$'
pass_filenames: false
entry: rustup run --install nightly-2023-07-09 cargo-clippy -- -- -D warnings
- id: build-no-features
name: Check crate build with no features
language: system
files: '[.]rs$'
pass_filenames: false
entry: cargo build --no-default-features
- id: build-all-features
name: Check crate builds with all features
language: system
files: '[.]rs$'
pass_filenames: false
entry: cargo build --all-features --lib --bins --examples
- id: test
name: Check tests pass
language: system
files: '[.]rs$'
pass_filenames: false
entry: cargo test --bins --lib --examples --all-features
- id: format
name: Check rustfmt
language: system
files: '[.]rs$'
pass_filenames: false
entry: rustup run --install nightly-2023-07-09 cargo-fmt --check
- id: msrv
name: Check MSRV compiles
language: system
files: '[.]rs$'
pass_filenames: false
entry: rustup run --install 1.65 cargo build
- id: docs
name: Check rustdoc compiles
language: system
files: '[.]rs$'
pass_filenames: false
entry: env RUSTDOCFLAGS="-D warnings" cargo doc
- id: actions
name: Check actions work
language: system
files: '^[.]github/workflows/'
pass_filenames: false
entry: act -q