NAME
Dist::Conformance::Update - What an update changed, or would change, in a checkout, and what it left to a person
VERSION
version 0.001
SYNOPSIS
use 5.040;
use Dist::Conformance::Snapshot::Directory;
use Dist::Conformance::Update;
my $update = Dist::Conformance::Update->new(
snapshot => Dist::Conformance::Snapshot::Directory->new( root => '/bogus/checkout' ),
dry_run => 1,
);
$update->write( '.perltidyrc', "-l=400\n" );
$update->by_hand('Write the prose of CLAUDE.md');
say "$_->{action} $_->{path}" for @{ $update->changes };
DESCRIPTION
A check's update does not write to the checkout itself. It calls the methods of this object, which write unless this is a dry run, and keep a record either way. So a dry run takes the same path through every check as a real one, and says what the real one would change.
A check runs with an object of its own, so the record of an update is the record of one check.
ATTRIBUTES
snapshot
Required. The writable Dist::Conformance::Snapshot to change.
dry_run
When true, nothing is written, and the changes are what would be written.
changes
The changes, in the order they were made: hash references with an action, which is create, replace or install, and a path.
manual
The things that no check could do, as sentences for a person.
METHODS
new
Dies unless "snapshot" is writable.
write
($path, $bytes, $mode). Writes $bytes to $path in the snapshot, with $mode, default 0644, and records a create or a replace. A file that already has these bytes is left alone, and nothing is recorded, so a second update after the first has nothing to do.
install_hook
($name, $bytes). Installs $bytes as the git hook $name of the checkout, and records an install of the hook's path, unless the hook that is installed has these bytes already. When the snapshot is not a git checkout, it records a line for "manual" instead.
by_hand
(@sentences). Records what a person has to do, because no check can do it safely.
SEE ALSO
Please see those modules/websites for more information related to this module.
BUGS
Please report any bugs or feature requests on the bugtracker website https://github.com/Troglodyne-Internet-Widgets/Dist-Conformance/issues
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
AUTHORS
Current Maintainers:
George S. Baugh <george@troglodyne.net>
COPYRIGHT AND LICENSE
Copyright (c) 2026 Troglodyne LLC
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.