community icon indicating copy to clipboard operation
community copied to clipboard

can we support "auto alphabetical order under" when add member in local ?

Open samzong opened this issue 1 year ago • 5 comments

like this.

  • first, add your name in org/memeber.yaml
  • second, run make format org/memeber.yaml

A simple script is all that's needed.

samzong avatar Jun 19 '23 02:06 samzong

PRs welcome if there is a good way to do this. fwiw I normally use IDE function to do it, but simple script would be nice

howardjohn avatar Jun 20 '23 22:06 howardjohn

I would like to try this. Assign me :)

ronitblenz avatar Jun 28 '23 06:06 ronitblenz

Some updates:

The script is running fine!

go run sort_names.go
Names sorted successfully!

But the catch is that we cant have two main func in a directory. So, I had to make a subfolder for members to fix this issue.

Now I have to make changes in the config_test.go.

ronitblenz avatar Jun 30 '23 07:06 ronitblenz

Hey @howardjohn @SAMZONG

I discovered a Quick Fix for it. I have made a directory called members, where you can add your name randomly. Now the script sorts the YAML and makes a copy of the tempname.yaml to generate updated members.yaml.

Screenshot 2023-06-30 at 1 27 53 PM

ronitblenz avatar Jun 30 '23 08:06 ronitblenz

I don't think we want to have people enter their names in multiple places. This leads to potential issues with changes overriding others or changes being lost. Maybe you have a script to grab the section from the member.yaml, sort it and put it back.

And how are you adding the updated list back into the PR. Are you having the automation create a new commit with the updated list?

ericvn avatar Jul 05 '23 14:07 ericvn