Visitar URL original
ensure-alphabetize should add a commit with alphabetized data if needed · Issue #991 · github/government.github.com · GitHub
Skip to content

ensure-alphabetize should add a commit with alphabetized data if needed #991

Open

Description

@mlinksva

That would be nice.

It's easy to cause the test to fail if one forgets how - sorts in a word or even adds superfluous space characters.

Activity

  1. psjnek commented on Jan 14, 2023

    @psjnek
    Contributor

    @mlinksva What exactly would resolve this problem? Changing the entry itself would break the link, right?

  2. psjnek commented on Jan 14, 2023

    @psjnek
    Contributor

    I'm going to leave open PRs that are failing the alphabetization test (which also can fail due to extra spaces, like this one) as motivation to fix #991 but feel free to make pass manually and I'll merge when you do.

    The tests seem to fail when new countries are added...

  3. mlinksva commented on Jan 14, 2023

    @mlinksva
    ContributorAuthor

    The tests sometimes fail when new countries are added because extra spaces are present, probably when adding a new line the via the web editor which indents to the previous level.

    - name: Ensure Orgs are sorted
    run: |
    bundle exec script/alphabetize
    git diff --color --exit-code

    The above sorts and overwrites the file, as a side effect without any extra spaces. It fails if diff has any output, whether from extra spaces or need to sort.

    The idea would be to commit the overwritten file if there is any diff, and push that commit, autocorrecting a file that differs from the canonical (including sorted) output rather than failing and requiring manual fixup.

  4. mlinksva commented on Jan 14, 2023

    @mlinksva
    ContributorAuthor
  5. mlinksva commented on Jan 14, 2023

    @mlinksva
    ContributorAuthor

    Nearly working in #1011 (comment)

  6. psjnek commented on Jan 23, 2023

    @psjnek
    Contributor

    The tests pass now in #1043.

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