Feature Request: Hashed Based Assertion

tcak via Digitalmars-d digitalmars-d at puremagic.com
Fri Nov 27 00:09:25 PST 2015


On Friday, 27 November 2015 at 05:33:52 UTC, deadalnix wrote:
> I see many solution here that do not require any language 
> change. To start, have a linter yell at the programmer when 
> (s)he submit a diff. Dev commit directly ? What the fuck are 
> you doing ? Do code review and get a linter.
>
> Alternatively, generate a di file and hash it. You can have a 
> bot do it and commit with a commit hook.
>
> DMD can dump infos about the program in json format. hash this 
> and run with it.
>
> You may also change your strategy in term of source control: 
> https://www.youtube.com/watch?v=W71BTkUbdqE . Unified source 
> code aleviate completely these kind of issues to boot.

Not one thing in your solutions give any simple solution like:

static assert( __traits( hashOf, std.file.read ) == 0x1234, "They 
have changed implementation again." );

static assert( __traits( hashOf, facebook.apis.addUser ) == 
0x5543, "Check API documentation again for addUser." );



di file wouldn't work. It doesn't contain implementation code. 
Also, all APIs are in it. We need specific hash for each API, so 
it doesn't take long time to find where the problem is.

JSON is same as di. No difference.


Yours are not helping, making everything more complex.


More information about the Digitalmars-d mailing list