Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer enforce to throw #279

Merged
merged 12 commits into from
Mar 29, 2020

Conversation

jondegenhardt
Copy link
Contributor

Code refactoring - Prefer enforce (from std.exception) over if-test plus throw new Exception. Minor, but reduces the volume of code, especially in command line argument validation.

Found one bug in the process - Field ranges ending in zero were not getting caught during command line argument checking. Only occurs in cases where zero is a valid value, and its for field ranges in reverse order so a rare case.

Added a couple missed unit tests, all in command line argument validation.

@codecov-io
Copy link

Codecov Report

Merging #279 into master will increase coverage by 0.08%.
The diff coverage is 99.38%.

@@            Coverage Diff             @@
##           master     #279      +/-   ##
==========================================
+ Coverage   99.15%   99.24%   +0.08%     
==========================================
  Files          17       17              
  Lines        5684     5689       +5     
==========================================
+ Hits         5636     5646      +10     
+ Misses         48       43       -5     
Impacted Files Coverage Δ
tsv-split/src/tsv_utils/tsv-split.d 98.50% <95.83%> (-0.01%) ⬇️
common/src/tsv_utils/common/utils.d 100.00% <100.00%> (+0.26%) ⬆️
csv2tsv/src/tsv_utils/csv2tsv.d 100.00% <100.00%> (+0.68%) ⬆️
tsv-append/src/tsv_utils/tsv-append.d 97.89% <100.00%> (ø)
tsv-filter/src/tsv_utils/tsv-filter.d 100.00% <100.00%> (ø)
tsv-join/src/tsv_utils/tsv-join.d 100.00% <100.00%> (ø)
tsv-pretty/src/tsv_utils/tsv-pretty.d 99.32% <100.00%> (+<0.01%) ⬆️
tsv-sample/src/tsv_utils/tsv-sample.d 99.43% <100.00%> (ø)
tsv-select/src/tsv_utils/tsv-select.d 100.00% <100.00%> (ø)
tsv-summarize/src/tsv_utils/tsv-summarize.d 98.18% <100.00%> (-0.01%) ⬇️
... and 1 more

@jondegenhardt jondegenhardt merged commit dbcce6a into eBay:master Mar 29, 2020
@jondegenhardt jondegenhardt deleted the prefer-enforce-to-throw branch March 29, 2020 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants