Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: cover all features with clippy #1044

Merged
merged 3 commits into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- uses: Swatinem/rust-cache@v1
- name: Test Format
run: cargo fmt -- --check
- run: cargo clippy --features unstable,legacy --tests -- -Dclippy::all
- run: cargo clippy --tests --all-features -- -Dclippy::all
windows:
name: Windows
runs-on: windows-latest
Expand Down
6 changes: 1 addition & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ Please use descriptive PR titles. We loosely follow the [conventional commits](h

Ensure the following are satisfied before opening a PR:
- Code is formatted with `rustfmt` by running `cargo fmt`
- Run `clippy`
- The exact command run by the CI is `cargo clippy --tests -- -Dclippy::all`
- Run tests with `cargo test`
- Test all examples with `./examples/test_all.sh`
- This must be done after the previous step
- Run all tests and linters with [./run-tests.sh](./run-tests.sh)
- Ensure any new functionality is adequately tested
- If any new public types or functions are added, ensure they have appropriate [rustdoc](https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) documentation
4 changes: 2 additions & 2 deletions near-sdk-macros/src/core_impl/abi/abi_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ impl ImplItemMethodInfo {
use MethodKind::*;

let some_abi_type = |result_serializer: &SerializerType| {
let abi_type = generate_abi_type(&return_value_type, result_serializer);
let abi_type = generate_abi_type(return_value_type, result_serializer);
quote! { Some(#abi_type) }
};

Expand Down Expand Up @@ -250,7 +250,7 @@ fn generate_schema(ty: &Type, serializer_type: &SerializerType) -> TokenStream2
}

fn generate_abi_type(ty: &Type, serializer_type: &SerializerType) -> TokenStream2 {
let schema = generate_schema(&ty, serializer_type);
let schema = generate_schema(ty, serializer_type);
match serializer_type {
SerializerType::JSON => quote! {
near_sdk::__private::AbiType::Json {
Expand Down
8 changes: 8 additions & 0 deletions run-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

set -e

cargo fmt --check --all
cargo clippy --tests --all-features -- -Dclippy::all
cargo test --all --features unstable,legacy
./examples/test_all.sh