Do not reformat setGeneric() calls with braces
Open
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 446
- Forks
- 32
- Avg merge
- 16h 48m
- Merged PRs (30d)
- 1
Description
According to the S4 chapter in advanced R:
It is bad practice to use
{}in the generic as it triggers a special case that is more expensive, and generally best avoided.# Don't do this! setGeneric("myGeneric", function(x) { standardGeneric("myGeneric") })
But air will do this.
You can test with:
setGeneric("thisIsALongGenericName", function(x, ...) standardGeneric("thisIsALongGenericName"))
Contributor guide
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.
Research direction
Reproduce the supplied R setGeneric() example in air and locate the formatter path handling calls with braced function bodies. Done means the long setGeneric() call is not reformatted with braces, with regression coverage for this example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r, rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 65/100