validate

package
v1.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package validate is used to ensure that the renaming operation cannot result in conflicts before the operation is carried out. It protects against the following scenarios:

1. Overwriting a newly renamed path. 2. Target destination contains forbidden characters (varies based on the operating system). 3. Target destination already exists on the file system (except if --allow-overwrite is specified) 4. Target name exceeds the maximum allowed length (255 characters in windows, and 255 bytes on Linux and macOS). 5. Target destination contains trailing periods in any of the sub paths (Windows only). 6. Target destination is empty.

It detects each conflicts and reports them, but it can also automatically fix them according to predefined rules (if -F/--fix-conflicts is specified).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConflicts

func GetConflicts() conflict.Collection

func Validate

func Validate(
	matches []*file.Change,
	autoFix, allowOverwrites bool,
) conflict.Collection

Validate detects and reports any conflicts that can occur while renaming a file. Conflicts are automatically fixed if specified in the program options.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL