Skip to content

ci: add clippy job and crate-level lint attributes - #75

Merged
arisu6804 merged 2 commits into
StreamPay-Organization:mainfrom
ifygreg01-best:feat/clippy-ci
Jul 22, 2026
Merged

ci: add clippy job and crate-level lint attributes#75
arisu6804 merged 2 commits into
StreamPay-Organization:mainfrom
ifygreg01-best:feat/clippy-ci

Conversation

@ifygreg01-best

Copy link
Copy Markdown
Contributor

Summary

Closes #56

Adds a dedicated Clippy CI job so every push and pull request to main is linted automatically, and enforces the same rules at the crate level so local cargo clippy is always consistent with CI.

Changes

.github/workflows/ci.yml

  • Splits the previous single fmt job into three parallel jobs: fmt, clippy, and test.
  • Each job installs only the toolchain components it needs (rustfmt / clippy).
  • The clippy job runs cargo clippy --all-targets -- -D warnings.

src/lib.rs

  • #![deny(clippy::all)] — hard error on all standard lints.
  • #![warn(clippy::pedantic)] — surfaces pedantic lints as warnings.
  • #![allow(...)] for known-safe patterns identified by code review:
    • cast_possible_truncation, cast_possible_wrap, cast_precision_loss, cast_sign_loss — u64→i128/u128/u32 casts in vesting math and ID counters are bounded by construction.
    • module_name_repetitionserror::Error, types::Stream, etc. are intentional.

README.md

  • Adds a new ## CI section documenting the three checks and the make lint shortcut.

Testing

The new clippy CI job will run automatically on this PR. Local verification requires cargo clippy --all-targets -- -D warnings.

- Add a dedicated clippy CI job that runs cargo clippy --all-targets
  with -D warnings on every push and pull request to main.
- Split the existing single fmt job into three parallel jobs:
  fmt, clippy, and test — each with explicit toolchain components.
- Add #![deny(clippy::all)] and #![warn(clippy::pedantic)] to lib.rs.
- Allow known-safe casts (cast_possible_truncation, cast_possible_wrap,
  cast_precision_loss, cast_sign_loss) and module_name_repetitions.
- Document the three CI checks in README.md under a new ## CI section.

Closes StreamPay-Organization#56
Two test functions were missing their closing :
- test_create_stream_zero_start_rejects_end_before_now (line 888)
- test_supply_recovers_after_full_withdraw_allowing_new_stream (line 1068)

This caused  to fail with 'unclosed delimiter', which in turn
blocked the clippy and test CI jobs from running.
@arisu6804
arisu6804 merged commit 2ed102f into StreamPay-Organization:main Jul 22, 2026
0 of 3 checks passed
@arisu6804

Copy link
Copy Markdown
Contributor

Merged — thanks @ifygreg01-best! CI is green on this repo now. 🚀

@grantfox-oss grantfox-oss Bot mentioned this pull request Jul 22, 2026
3 tasks
arisu6804 added a commit that referenced this pull request Jul 22, 2026
…y job passes

PR #75 added a clippy CI job plus #![warn(clippy::pedantic)]. Under -D
warnings the pedantic lints (must_use_candidate, doc_markdown, ...) fail
the build across code not written for them. Kept the meaningful
deny(clippy::all) and removed the pedantic warn so CI is green.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add clippy lints to CI

2 participants