I was looking through the Dev.to source, and the first thing that jumped out at me was the Gemfile was sorted (within each group). This made it much easier to scan and think about their dependencies.
Using Vim, I was able to sort my Gemfile in a couple of seconds.
- Select the lines within the group (or all of those outside of a group).
- enter command mode (:) and type sort
Thatβs it. Now, if you were like me, you still sometimes flipflop between β and β (working on it!), you will need to pick one (β) and do a find and replace %s/'/"/g
as well otherwise things will not sort quite right.
Top comments (1)
We do this on CodeFund. github.com/gitcoinco/code_fund_ads/
I also do it on most of my side projects. I think it makes sense to sort any list that you need/want to scan visually. Things like permitted strong parameter attributes in your controllers, etc... Sorting helps you find things quickly and detect potential issues (like duplicate entries).