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

When running --locked, check formatting of store files #348

Merged
merged 1 commit into from
Oct 31, 2022

Commits on Oct 28, 2022

  1. When running --locked, check formatting of store files

    This will detect issues like audits being out of order and unrecognized
    fields in CI, and should help avoid simple executions of `cargo vet`
    causing formatting changes locally.
    
    The implementation isn't particularly efficient for this, in that it
    immediately attempts to re-serialize the file after parsing it, and then
    compares the results (ignoring trailing newlines). As this checks
    formatting, it is a string-based check, and not structural.
    
    The `similar` library, which we already used for our tests, is used to
    allow including diffs in the output to make any issues more clear. This
    also required some changes to the way we read/write files from disk to
    keep information around.
    
    As a side-effect of these changes, we no longer emit an extra
    unnecessary newline at the end of store files. This won't be detected as
    an error by the checker, but will be a change when run locally.
    
    Fixes mozilla#341
    mystor committed Oct 28, 2022
    Configuration menu
    Copy the full SHA
    422587c View commit details
    Browse the repository at this point in the history