Recognize Rust function modifier combinations in the spacing helper
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start in tools/format-rust.py, focusing on is_function_start and add_function_spacing; read the existing prefix checks and how the helper distinguishes function bodies. Add the requested table-driven Python regression for modifier combinations, restricted visibility, bodyless declarations, and extern blocks. Run the regression and confirm adjacent functions are separated without false positives from strings or extern blocks.
Written by the indexing model from the issue text.
Description
Problem
is_function_start uses a short prefix list. Valid pub(crate) const fn functions and other modifier combinations are not detected, leaving adjacent functions unseparated.
Reproduction
Executed the helper at fd07427f4a976de05e38eff3ee1760db97fbb761 using importlib and add_function_spacing on:
pub(crate) const fn first() {}
pub(crate) const fn second() {}
The result is unchanged; the intended separating blank line is missing. Starting point: tools/format-rust.py.
Scope
Recognize legal visibility and const/async/unsafe/extern combinations without treating arbitrary extern blocks or fn text in strings as functions. Difficulty: easy.
Completion criteria
- Cover combined modifiers and restricted visibility.
- Keep bodyless declarations and extern blocks distinct.
- Add a small table-driven Python regression.
- Dominant language
- Rust
- Stars
- 56
- Forks
- 21
- Avg merge
- 4h 44m
- Merged PRs (30d)
- 57
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from wavefnd/Wave
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
enhancement good first issue needs testing
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Distinguish Rust character literals from lifetimes in the spacing helperPossibly taken A pull request linked to this issue is open or already merged. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
documentation enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
longbridge/gpui-kit#3620 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
mongodb/kingfisher#564 ·
Maintainers usually reply within 1 day
-
bug qq-feedback
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
corro-client drops the last byte of a response line that has no trailing newlinePossibly taken @RaphaelFakhri claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
proxy: include denial_category in the "proxy request denied" log linePossibly taken @sreyas-endor claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
nolabs-ai/nono#2172 · 1 comment ·
Maintainers usually reply within 1 day