rrrene / credo

A static code analysis tool for the Elixir language with a focus on code consistency and teaching.
http://credo-ci.org/
MIT License
4.93k stars 417 forks source link

Add test for case-sensitive alias ordering #1006

Closed alecho closed 10 months ago

alecho commented 2 years ago

I have an app where this is the case. Vim's sort and recode's alias order say that this test should be correct but credo disagrees.

I took a stab at trying to fix this but I only had a limited time and I couldn't get it work work with existing tests. I'll open an issue and link theses. Let me know if there's anything else I can do.

rrrene commented 2 years ago

The check is supposed to do the opposite of your test.

In the current implementation, we want "natural language sorting", i.e. the way people unaware of ASCII would sort letters manually a > A > b > B > c.

If you want to provide a different implementation, it should be opt-in :+1:

alecho commented 2 years ago

@rrrene Thanks for the comment. I was able to get an implementation working more easily than I expected. I added a test for each path, both raising issues and passing. Let me know what else I can do!

alecho commented 1 year ago

@rrrene Anything I can do to help move this along?