Skip to content

Commit ab22f96

Browse files
committed
Merge branch 'main' of github.com:NethermindEth/pluto into dkg_nodesigs
2 parents 55c3193 + 4d3b110 commit ab22f96

File tree

14 files changed

+2109
-135
lines changed

14 files changed

+2109
-135
lines changed

.claude/skills/rust-style/SKILL.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,25 @@ let x = a.checked_add(b).ok_or(Error::Overflow)?;
6161

6262
## Casts
6363

64-
No lossy or unchecked casts — use fallible conversions:
64+
**Never use `as` for numeric type conversions** — use fallible conversions with `try_from`:
6565

6666
```rust
67-
// Bad
67+
// Bad - will cause clippy errors
6868
let x = value as u32;
69+
let y = some_usize as u64;
6970

70-
// Good
71+
// Good - use try_from with proper error handling
7172
let x = u32::try_from(value)?;
73+
let y = u64::try_from(some_usize).expect("message explaining why this is safe");
7274
```
7375

76+
Rules:
77+
78+
- Always use `TryFrom`/`try_from` for numeric conversions between different types
79+
- Handle conversion failures explicitly (either with `?` or `expect` with justification)
80+
- The only acceptable use of `expect` is when the conversion is guaranteed to succeed (e.g., `usize` to `u64` on 64-bit platforms)
81+
- Clippy will error on unchecked `as` casts: `cast_possible_truncation`, `cast_possible_wrap`, `cast_sign_loss`
82+
7483
---
7584

7685
## Async / Tokio

.github/workflows/claude-code-review.yml

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,20 @@
11
name: Claude Code Review
22

33
on:
4-
pull_request:
5-
types: [review_requested]
6-
# Optional: Only run on specific file changes
7-
# paths:
8-
# - "src/**/*.ts"
9-
# - "src/**/*.tsx"
10-
# - "src/**/*.js"
11-
# - "src/**/*.jsx"
4+
issue_comment:
5+
types: [created]
126

137
jobs:
148
claude-review:
15-
# Only run when a specific reviewer is requested (e.g., "claude-code" or specific team)
169
if: |
17-
contains(github.event.pull_request.requested_reviewers.*.login, 'claude-code') ||
18-
contains(github.event.pull_request.requested_teams.*.slug, 'claude-code')
10+
github.event.issue.pull_request != null &&
11+
contains(github.event.comment.body, '/claude-review')
1912
2013
runs-on: ubuntu-latest
2114
permissions:
2215
contents: read
23-
pull-requests: read
24-
issues: read
16+
pull-requests: write
17+
issues: write
2518
id-token: write
2619

2720
steps:
@@ -49,9 +42,6 @@ jobs:
4942
uses: anthropics/claude-code-action@v1
5043
with:
5144
anthropic_api_key: ${{ secrets.CLAUDE_CODE_API_KEY }}
45+
github_token: ${{ secrets.GITHUB_TOKEN }}
5246
track_progress: true
53-
plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
54-
plugins: 'code-review@claude-code-plugins'
55-
prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}'
56-
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
57-
# or https://code.claude.com/docs/en/cli-reference for available options
47+
prompt: '/review-pr ${{ github.event.pull_request.number || github.event.issue.number }}'

0 commit comments

Comments
 (0)