Skip to content

fix: use second precision when comparing file mod times #345

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

Merged
merged 1 commit into from
Jul 7, 2024

Conversation

brianmcgee
Copy link
Member

@brianmcgee brianmcgee commented Jul 6, 2024

We were using whatever precision the underlying file system was giving us, and in some cases that can be very detailed. Some formatters mess with the mod time, but not to the same precision (e.g. dos2unix).

POSIX also specifies that mod time should be EPOCH (second) precision.

This change brings us back in line with how 1.x worked, and should resolve issues with false fail on change errors.

TODO

  • Add dos2unix and yamlfmt to examples/tests

Closes #342

We were using whatever precision the underlying file system was giving us, and in some cases that can be very detailed. Some formatters mess with the mod time, but not to the same precision (e.g. dos2unix).

POSIX also specifies that mod time should be EPOCH (second) precision.

This change brings us back in line with how 1.x worked, and should resolve issues with false fail on change errors.
@brianmcgee brianmcgee force-pushed the fix/fail-on-change branch from 7cb6923 to 85ce0a2 Compare July 6, 2024 16:38
@brianmcgee brianmcgee merged commit 65152cb into main Jul 7, 2024
20 checks passed
@brianmcgee brianmcgee deleted the fix/fail-on-change branch July 7, 2024 10:17
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.

Inconsistent: error: unexpected changes detected, --fail-on-change is enabled
2 participants