sourcebots / volunteer-docs

Documentation and Information for Volunteers
https://volunteering.sourcebots.co.uk
1 stars 1 forks source link

Add .spelling sort script #28

Closed Adimote closed 6 years ago

Adimote commented 6 years ago

add a script and rule to enforce that the .spelling file is sorted

resolves #22

Adimote commented 6 years ago

@RealOrangeOne @trickeydan please re-review as I've fixed the issues

kierdavis commented 6 years ago

Surely just sort --check .spelling would accomplish more or less the same thing as this, in a far more maintainable way?

EDIT: my proposal doesn't warn about duplicates (so long as the file is still sorted) whereas the implementation in the PR does, but it still feels like a step in the right direction. EDIT 2: sort --check --unique .spelling does the job.

Adimote commented 6 years ago

@kierdavis didn't know about that flag, that's much better!

Adimote commented 6 years ago

So, funny story: It turns out sort is non-deterministic depending on what system you run it.

It also turns out that whatever system circleci runs it on has a different sort to mine, so when I ran sort it was sorting uppercase letters with lowercase, circleci was then checking it and saying it was wrong, because it expects it to be uppercase first then lowercase.

I've now changed a variable which now forces uppercase first