AutoEquatable and AutoHashable by Sourcery
I’m really interested in Sourcery, so I installed it in my one of repositories. In my case, I generated
AutoHashable at first because I felt these implementations contain really a lot of boilerplate codes.
Here is an actual PR in EsaKit.
If I confirm to
AutoHashable or both,
Sourcery creates a needed function automatically like this.
If I add a new property or a new API, it prevents a human error! Though it looks trivial,
Sourcery uses a safe
Hashable as I mentioned in Safe Hashable in Swift. Isn’t it cool?
Note to self:
I created a simple script for
Sourcery, and then I run
Sourcery command in this script. I had a
Sourcery.swift file to define
Auto*** commands like this.
If I move
Sourcery didn’t create any codes:( I didn’t know it has a such a specification until I have met this problem.
So I had to put in under the
/EsaKit/Models like this
/EsaKit/Models/Sourcery.swift because all structs confirmed to
Auto*** is in
Please be careful about
Auto*** files directory.
However, I totally recommend it.
Sourcery saved a lot of repetitive works:)