Skip to content

Add suppression comment support #52

Closed

Description

@DavisVaughan
No description provided.

Activity

  1. DavisVaughan commented on Jan 21, 2025

    @DavisVaughan
    CollaboratorAuthor

    From #185 :

    ruff format supports # fmt: off, # fmt: on and # fmt: skip pragma comments to selectively disable the formatter. (https://docs.astral.sh/ruff/formatter/#format-suppression)

    It'd be neat if air supported a similar system for selective disabling formatting, which might look like this:

    # fmt: off
    private$event_callback_counts[[domain]] <- private$event_callback_counts[[domain]] - 1
    # fmt: on
    
    private$event_callback_counts[[domain]] <- private$event_callback_counts[[domain]] + 1 # fmt: skip
  2. jayhesselberth commented on Jan 28, 2025

    @jayhesselberth

    This came up previously in styler: r-lib/styler#365

    Running air on the pkgdown source, tribbles (with an "r") are another case where the intentional formatting is important for readability, and these are clobbered by air.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions