mirror of
https://github.com/restic/restic.git
synced 2026-07-17 04:34:53 +00:00
Add codespell support with configuration and fixes (#21807)
Co-authored-by: Claude Code 2.1.142 / Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Code 2.1.142 / Claude Opus 4.7
parent
c221cd06ad
commit
451cc6c048
+1
-1
@@ -137,7 +137,7 @@ var (
|
||||
|
||||
// Cached uid lookup by user name. Returns 0 when no id can be found.
|
||||
//
|
||||
//nolint:revive // captialization is correct as is
|
||||
//nolint:revive // capitalization is correct as is
|
||||
func lookupUid(userName string) uint32 {
|
||||
userNameLookupCacheMutex.RLock()
|
||||
uid, ok := userNameLookupCache[userName]
|
||||
|
||||
@@ -74,7 +74,7 @@ func (r *packerManager) Flush(ctx context.Context) error {
|
||||
|
||||
// mergePackers merges small pack files before those are uploaded by Flush(). The main
|
||||
// purpose of this method is to reduce information leaks if a small file is backed up
|
||||
// and the blobs end up in spearate pack files. If the file only consists of two blobs
|
||||
// and the blobs end up in separate pack files. If the file only consists of two blobs
|
||||
// this would leak the size of the individual blobs.
|
||||
func (r *packerManager) mergePackers() ([]*packer, error) {
|
||||
pendingPackers := []*packer{}
|
||||
|
||||
@@ -342,7 +342,7 @@ func calculateTargetPacksize(opts PruneOptions, indexPack map[restic.ID]packInfo
|
||||
return cmp.Compare(a.size, b.size)
|
||||
})
|
||||
|
||||
// Using the approximatelly 3rd percentile is just a heuristic and may not always be the optimal choice.
|
||||
// Using the approximately 3rd percentile is just a heuristic and may not always be the optimal choice.
|
||||
// However, using a low percentile ensures that only a small fraction of the repository
|
||||
// may end up being repacked. By using 80% of that perecentile or the minimum pack size,
|
||||
// we ensure that no repacking happens if the repository already has no small pack files.
|
||||
|
||||
@@ -133,7 +133,7 @@ func TestPruneSmall(t *testing.T) {
|
||||
|
||||
keep := restic.NewBlobSet()
|
||||
rtest.OK(t, repo.WithBlobUploader(context.TODO(), func(ctx context.Context, uploader restic.BlobSaverWithAsync) error {
|
||||
// we need a minum of 11 packfiles, each packfile will be about 5 Mb long
|
||||
// we need a minimum of 11 packfiles, each packfile will be about 5 Mb long
|
||||
for i := 0; i < numBlobsCreated; i++ {
|
||||
buf := make([]byte, blobSize)
|
||||
random.Read(buf)
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
|
||||
// UidGidInt returns uid, gid of the user as a number.
|
||||
//
|
||||
//nolint:revive // captialization is correct as is
|
||||
//nolint:revive // capitalization is correct as is
|
||||
func UidGidInt(u *user.User) (uid, gid uint32, err error) {
|
||||
ui, err := strconv.ParseUint(u.Uid, 10, 32)
|
||||
if err != nil {
|
||||
|
||||
@@ -185,7 +185,7 @@ func (r *fileRestorer) restoreFiles(ctx context.Context) error {
|
||||
file.sparse = false
|
||||
}
|
||||
|
||||
// empty file or one with already uptodate content. Make sure that the file size is correct
|
||||
// empty file or one with already up-to-date content. Make sure that the file size is correct
|
||||
if !restoredBlobs {
|
||||
err := r.truncateFileToSize(file.location, file.size)
|
||||
if errFile := r.sanitizeError(file, err); errFile != nil {
|
||||
|
||||
@@ -232,7 +232,7 @@ func (w *filesWriter) writeToFile(path string, blob []byte, offset int64, create
|
||||
bucket.files[path].users--
|
||||
if bucket.files[path].users == 0 {
|
||||
delete(bucket.files, path)
|
||||
// Add to cache to allow re-use. Cache will close files on overflow.
|
||||
// Add to cache to allow reuse. Cache will close files on overflow.
|
||||
w.cacheMu.Lock()
|
||||
w.cache.Add(path, wr)
|
||||
w.cacheMu.Unlock()
|
||||
|
||||
Reference in New Issue
Block a user