+
Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

fix(rome_cli): fix small CLI and test issues #3853

Merged
merged 3 commits into from
Nov 25, 2022
Merged

fix(rome_cli): fix small CLI and test issues #3853

merged 3 commits into from
Nov 25, 2022

Conversation

leops
Copy link
Contributor

@leops leops commented Nov 25, 2022

Summary

I grouped two very small fixes to the CLI into this since I didn't want to open a PR for each of these:

  • The first change is to use checked arithmetic when calculating the number of processed files. The CLI checks that at least one file was processed by subtracting the number of skipped files from the total number of files that were read, however in case a file fails to be read from the disk it will increment the skipped counter but not the total counter, making the subtraction panic in debug builds and to an integer underflow on release builds.
  • The second change is an update to the Unix-specific snapshots of the CLI that were missed when I merged fix(rome_cli): normalize the content of CLI snapshots #3835, since I ran the snapshot update on Windows but not on Unix.

Test Plan

I've added a new test case for the first change, and the second one is specifically about fixing tests anyway.

@leops leops requested a review from ematipico as a code owner November 25, 2022 09:01
@netlify
Copy link

netlify bot commented Nov 25, 2022

Deploy Preview for docs-rometools canceled.

Name Link
🔨 Latest commit 90565be
🔍 Latest deploy log https://app.netlify.com/sites/docs-rometools/deploys/6380918a54daea00095d0629

@leops leops merged commit db3d777 into main Nov 25, 2022
@leops leops deleted the fix/cli-misc branch November 25, 2022 10:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载