posit-dev / posit-dev/air

Try to break long lines at assignment first before breaking within RHS

Open
#183 11 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
446
Forks
32
Avg merge
16h 48m
Merged PRs (30d)
1

Description

In chromote, we had this line

private$event_callback_counts[[domain]] <- private$event_callback_counts[[domain]] - 1

which, when wrapped to 80 characters with air 1.0.0 becomes

private$event_callback_counts[[domain]] <- private$event_callback_counts[[
        domain
      ]] -
        1

but I'd much rather this break at the <- (without me having to introduce that break manually)

private$event_callback_counts[[domain]] <- 
  private$event_callback_counts[[domain]] - 1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the chromote example from the issue with air's 80-character wrapping. Trace the formatter's line-breaking logic around assignment operators and compare its output with the two examples shown. Done means the assignment breaks before the right-hand side without manually inserted line breaks.

Written by the indexing model from the issue text.

Assessment

Tech stack
r, rust
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.