Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Provide an easy way to format lint messages with user-specified width #1884

@IndrajeetPatil

Description

@IndrajeetPatil

No matter where lint messages are printed (e.g. GitHub annotations, RStudio markers, Markdown in GitHub issues, etc.), currently, there is no straightforward way to print them with a certain width. This means that the user always needs to scroll horizontally to see many of the lint messages.

options(width = 50)
library(lintr)

lint(
  text = "x <- c();",
  linters = unnecessary_concatenation_linter()
)
#> <text>:1:6: style: [unnecessary_concatenation_linter] Unneeded concatenation without arguments. Replace the "c" call by NULL or, whenever possible, vector() seeded with the correct type and/or length.
#> x <- c();
#>      ^~~

Created on 2023-01-03 with reprex v2.0.2

A typical project that starts using linters might throw hundreds of messages, and that's a lot of scrolling. This might be mildly annoying for an able-bodied individual like me, but must be extremely challenging and disappointing for people with mobility impairment. Almost every single lint asks them to scroll to see the full lint message.

We should anticipate this and provide a way out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions