pub struct Formatting { /* private fields */ }
Expand description

Run a formatter in the repository to check commits for formatting.

The formatter is passed a single argument: the path to the file which should be checked.

The formatter is expected to exit with success whether the path passed to it has a valid format in it or not. A failure exit status is considered a failure of the formatter itself. If any changes (including untracked files) are left inside of the worktree, it is considered to have failed the checks.

The formatter is run with its current working directory being the top-level of the work tree, but not the proper GIT_ context. This is because the setup for the workarea is not completely isolated and git commands may not behave as expected. The worktree it is working from is only guaranteed to have the files which have changed in the commit being checked on disk, so additional files which should be available for the command to run must be specified with Formatting::add_config_files.

Implementations

Create a new builder.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

The name of the check.

Run the check.

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

The name of the check.

Run the check.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The name of the check.

Run the check.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.