Closed carlschroedl closed 6 years ago
Ah, I forgot to clean up this PR. Sorry about distracting you with this one. I already checked in tools/condorcet_checker.php as part of a different PR that I merged.
Sorry Tyler, I do not understand your comment. Could you please take another look at this and perhaps explain the reasoning a different way? I do not understand why this was closed. I think this PR offers largely similar functionality to the recently-merged condorcet_checker.php, but with the added benefit of being compatible with the build system. I propose that we merge this, port any differences in tools/condorcet_checker.php into the classes defined in this PR, and then delete tools/condorcet_checker.php so that we can easily run the auto-generated graph tests while playing nice with the build system.
Does that make sense?
In case it's not clear: I did not write this code from scratch -- it's a Tyler original in slightly different packaging.
Also I don't like the file names I chose, feel free to choose more descriptive names.
I ported in the changes and switched to files names that make more sense.
The changes look good! I'm just not very ambitious about merging, so if this were my PR, I would have abandoned once there was the need to merge changes across file names, then start from fresh. Looks like you figured out a way to do it though, so feel free to merge into 0.x.
I wouldn't check in the test cases though (I had just thrown them there to show you).
Ah gotcha, thanks. Yeah in retrospect it might have been faster to do what you mentioned. I can't update the PR now that I'm on the road, so I'm going to merge as-is. Feel free to remove the extra test case files.
I brought the tool you wrote into the rest of the build system.
You should now be able to take advantage of the build's syntax checking, static analysis and style checking by running
vendor/bin/phing
Most style deviations can be corrected automatically via
vendor/bin/phpcbf src tests
.At some point we can package this as a command line app by adding phar-composer to phing's build.xml. A starting point is this blog post.
Until then the binary can be run via:
cd bin
php bulk_ballot_test.php -some -args -here
If you get an error about a class not being available, try running
phing
again to ensure all relevant classes are included in the autoloader that is referenced in bin/bulk_ballot_test.php.