1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-03 00:57:52 +02:00

Enable intrange linter, and fix warnings

This commit is contained in:
Stefan Haller
2025-06-30 11:03:00 +02:00
parent 1e92d8b7f3
commit 0471dbaa84
21 changed files with 35 additions and 34 deletions

View File

@ -257,7 +257,7 @@ func (self *Shell) CreateNCommitsStartingAt(n, startIndex int) *Shell {
// Only to be used in demos, because the list might change and we don't want
// tests to break when it does.
func (self *Shell) CreateNCommitsWithRandomMessages(n int) *Shell {
for i := 0; i < n; i++ {
for i := range n {
file := RandomFiles[i]
self.CreateFileAndAdd(
file.Name,
@ -286,7 +286,7 @@ func (self *Shell) CreateRepoHistory() *Shell {
totalCommits := 0
// Generate commits
for i := 0; i < numInitialCommits; i++ {
for i := range numInitialCommits {
author := authors[i%numAuthors]
commitMessage := RandomCommitMessages[totalCommits%len(RandomCommitMessages)]
@ -296,7 +296,7 @@ func (self *Shell) CreateRepoHistory() *Shell {
}
// Generate branches and merges
for i := 0; i < numBranches; i++ {
for i := range numBranches {
// We'll have one author creating all the commits in the branch
author := authors[i%numAuthors]
branchName := RandomBranchNames[i%len(RandomBranchNames)]
@ -309,7 +309,7 @@ func (self *Shell) CreateRepoHistory() *Shell {
self.NewBranchFrom(branchName, fmt.Sprintf("master~%d", commitOffset))
numCommitsInBranch := rand.Intn(maxCommitsPerBranch) + 1
for j := 0; j < numCommitsInBranch; j++ {
for range numCommitsInBranch {
commitMessage := RandomCommitMessages[totalCommits%len(RandomCommitMessages)]
self.SetAuthor(author, "")