Skip to content

Feature Request: skip_last_lines (in addition to skip_lines=x) #80

Description

@aranair

When running keep-sorted in our ruby code base, we have the following syntax that wraps arrays

# keep-sorted start
SOME_ARRAY = %w[
  AAA
  BBB
  CCC
].freeze
# keep-sorted end

We are unable to nest the # keep-sorted start/end within the array because of the %w. E.g. this is incorrect

SOME_ARRAY = %w[
  # keep-sorted start
  AAA
  BBB
  CCC
  # keep-sorted end
].freeze

What we're doing as somewhat of a workaround, which we believe is effectively sorting the last row ].freeze as well (which would be incorrect)

# keep-sorted start skip_lines=1 block=yes
SOME_ARRAY = %w[
  AAA
  BBB
  CCC
].freeze
# keep-sorted end

The feature request is to add a syntax that allows something like this:

# keep-sorted start skip_lines=1 skip_last_lines=1 block=yes
SOME_ARRAY = %w[
  AAA
  BBB
  CCC
].freeze
# keep-sorted end

Activity

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