From 18c5743c597c273d467a5d059d6a262364f52fe8 Mon Sep 17 00:00:00 2001 From: Terry Bolt Date: Thu, 30 Nov 2017 17:57:11 +0000 Subject: [PATCH] Release 0.1.0 Signed-off-by: Terry Bolt --- CODE-OF-CONDUCT.md | 74 ++++++++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 9 ++++++ README.md | 37 ++++++++++++++++++++++- src/main.rs | 2 +- 4 files changed, 120 insertions(+), 2 deletions(-) create mode 100644 CODE-OF-CONDUCT.md diff --git a/CODE-OF-CONDUCT.md b/CODE-OF-CONDUCT.md new file mode 100644 index 0000000..558af4a --- /dev/null +++ b/CODE-OF-CONDUCT.md @@ -0,0 +1,74 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +education, socio-economic status, nationality, personal appearance, race, +religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at [INSERT EMAIL ADDRESS]. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + diff --git a/Cargo.toml b/Cargo.toml index 0cb3d66..ddf1306 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,15 @@ name = "good_stv" version = "0.1.0" authors = ["Terry Bolt "] +description = "A tool for evaluating elections using Single Transferable Vote." + +categories = ["command-line-interface","command-line-utilities","parsing","algorithms"] +keywords = ["redbrick","vote","cli"] +license = "GPL-3.0" +readme = "README.md" + +[badges] +travis-ci = { repository = "redbrick/good_stv" } [dependencies] clap = "2.27.1" diff --git a/README.md b/README.md index 1bfe48b..4f0bd22 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,44 @@ # good_stv -A good stv utility. +A tool for evaluating elections using [Single Transferable +Vote](https://en.wikipedia.org/wiki/Single_transferable_vote). [![Build Status](https://travis-ci.org/redbrick/good_stv.svg?branch=master)](https://travis-ci.org/redbrick/good_stv) +## Usage + +good_stv expects to receive CSV-formatted data, either on stdin or a file. The +only required argument is a positive integer representing the number of seats +to fill in the election. Example invocations are: + +```sh +$ good_stv -f test.csv 3 +``` + +```sh +$ good_stv 3 < test.csv +``` + +### CSV format + +The input data is expected to be in the following format: + +One (1) header line, with a list of candidates to be elected, in any order. +This is followed by any number of body lines, each containing a list of +candidates, in order of preference from highest to lowest, left to right, +representing a single vote. Any candidates listed in the body who are not also +in the header will be ignored. Each vote does not need to include every +candidate, although votes listing zero (0) candidates will be ignored. + +#### Example + +```csv +alice,bob,charlie +alice,bob +bob,charlie,alice +bob +``` + ## License ```text diff --git a/src/main.rs b/src/main.rs index 858129b..c05231e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -54,7 +54,7 @@ fn run() -> Result<(), Error> { .version(VERSION.unwrap_or("unknown")) .author("Terry Bolt ") .about( - "A good single transferable vote utility for simple elections.", + "A tool for evaluating elections using Single Transferable Vote." ) .arg(Arg::with_name("seats").index(1).required(true).help( "Number of seats to be filled.",