c-3lab / dim

📦 dim: Manage the open data in your project like a package manager.
MIT License
126 stars 21 forks source link

Add integrity to dim-lock.json #96

Closed Syuparn closed 1 year ago

Syuparn commented 1 year ago

This PR enables to save data's integrity in dim-lock.json. Integrities are calculated by SHA-1.

close #94

Syuparn commented 1 year ago

I checked integrities in test cases are same as ones generated by openssl command.

$ echo -n after | openssl sha1
(stdin)= 405906c9d5be6ae5393ca65fb0e7c38e0d585ecb

$ echo -n dummy | openssl sha1
(stdin)= 829c3804401b0727f70f73d4415e162400cbe57b

$ cat tests/test_data/searchData.json | openssl sha1
(stdin)= 1a6d8dd620cf4cfd2b9999002d79a89e0d18496d

$ cat tests/test_data/external-dim.json | openssl sha1
(stdin)= 25a368f44b6dcaa16c9e4e2fb8e67a9d2543c462

$ cat tests/test_data/test.xls | openssl sha1
(stdin)= f66551793c54c4af590dc406d0a3811a92aea645

$ cat tests/test_data/test.xlsx | openssl sha1
(stdin)= 775287470f019036b49c1bc3438e9fcc08839eb6

$ echo -n テストデータ | iconv -t sjis | openssl sha1
(stdin)= 1ca77c31190bc266ef2288118edc677fed24b130
codecov[bot] commented 1 year ago

Codecov Report

Merging #96 (09ccd49) into main (f1a90dd) will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main       #96   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           18        18           
  Lines         1183      1190    +7     
  Branches       128       128           
=========================================
+ Hits          1183      1190    +7     
Impacted Files Coverage Δ
deps.ts 100.00% <100.00%> (ø)
libs/action_helper/installer.ts 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

ryo-ma commented 1 year ago