Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create options for human-readable output formats (#437)
* Add a -summary option to print a short summary of the linting Linting the test file `testdata/utf8ControlX88.pem` results in: ``` +-------+--------------+ | LEVEL | # OCCURANCES | +-------+--------------+ | info | 0 | | warn | 7 | | error | 15 | | fatal | 0 | +-------+--------------+ ``` * Added -longsummary option and output Running: ```sh testdata/indivValAllBad.pem | ./zlint -longsummary ``` the output is: ``` +-------+--------------+------------------------------------------+ | LEVEL | # OCCURANCES | DETAILS | +-------+--------------+------------------------------------------+ | info | 0 | - | | warn | 1 | w_ext_san_critical_with_subject_dn | | error | 7 | e_ca_crl_sign_not_set | | | | e_sub_ca_crl_distribution_points_missing | | | | e_ca_country_name_missing | | | | e_cert_policy_iv_requires_country | | | | e_sub_cert_not_is_ca | | | | e_ca_key_cert_sign_not_set | | | | e_ca_organization_name_missing | | fatal | 0 | - | +-------+--------------+------------------------------------------+ ``` * spelling fix * Remove tablewriter dependency and reimplement the good parts * spelling fix * Fixed a missed merge :( * switched longsummary to longSummary; fixed output bug - switched `-longsummary` option to `-longSummary` to be more consistent with existing options - fixed an embarrassing output bug when two categories had the same number of errors * Cleaned up typos, variable names, formatting * parent 9957909 author Andrew Caird <acaird@gmail.com> 1590420366 -0400 committer Andrew Caird <acaird@gmail.com> 1593372751 -0400 Add a -summary option to print a short summary of the linting Linting the test file `testdata/utf8ControlX88.pem` results in: ``` +-------+--------------+ | LEVEL | # OCCURANCES | +-------+--------------+ | info | 0 | | warn | 7 | | error | 15 | | fatal | 0 | +-------+--------------+ ``` and a -longSummary option and output Running: ```sh testdata/indivValAllBad.pem | ./zlint -longsummary ``` the output is: ``` +-------+--------------+------------------------------------------+ | LEVEL | # OCCURANCES | DETAILS | +-------+--------------+------------------------------------------+ | info | 0 | - | | warn | 1 | w_ext_san_critical_with_subject_dn | | error | 7 | e_ca_crl_sign_not_set | | | | e_sub_ca_crl_distribution_points_missing | | | | e_ca_country_name_missing | | | | e_cert_policy_iv_requires_country | | | | e_sub_cert_not_is_ca | | | | e_ca_key_cert_sign_not_set | | | | e_ca_organization_name_missing | | fatal | 0 | - | +-------+--------------+------------------------------------------+ ``` * autopull: 2020-05-27T14:34:02Z (#441) Co-authored-by: tld-update-bot <cpu+tldbot@letsencrypt.org> * gTLD autopull: 2020-05-28T14:35:00Z (#442) Co-authored-by: tld-update-bot <cpu+tldbot@letsencrypt.org> * Moved structure creation out of function into a method for reporting * Moved the formatted output routines out of main * Changed newRT to a pointer receiver * Changed output options to all them all; newlines for nice output * Changed output options to allow printing of them all; newlines for nice output Co-authored-by: Zakir Durumeric <zakird@gmail.com> Co-authored-by: Daniel McCarney <daniel@binaryparadox.net> Co-authored-by: TLD Update Robot <47792085+tld-update-bot@users.noreply.github.com> Co-authored-by: tld-update-bot <cpu+tldbot@letsencrypt.org>
- Loading branch information