@@ -3,13 +3,13 @@ package main_test
33import (
44 "math"
55 "os"
6- main "snekcheck/cmd/snekcheck"
7- "snekcheck/internal/files"
86 "testing"
97
108 "github.com/go-git/go-billy/v5"
119 "github.com/go-git/go-billy/v5/memfs"
1210 "github.com/stretchr/testify/suite"
11+ main "snekcheck/cmd/snekcheck"
12+ "snekcheck/internal/files"
1313)
1414
1515type RunTestSuite struct {
@@ -38,7 +38,13 @@ func (suite *RunTestSuite) TestRun() {
3838 })
3939 suite .Run ("check" , func () {
4040 suite .Run ("succeeds with an empty directory" , func () {
41- config := main.Config {Depth : math .MaxUint , Fs : suite .Fs , Fix : false , Paths : []files.Path {suite .Root }, Verbose : false }
41+ config := main.Config {
42+ Depth : math .MaxUint ,
43+ Fs : suite .Fs ,
44+ Fix : false ,
45+ Paths : []files.Path {suite .Root },
46+ Verbose : false ,
47+ }
4248 suite .Nil (main .Run (config ))
4349 })
4450 suite .Run ("succeeds with a single valid file" , func () {
@@ -47,7 +53,13 @@ func (suite *RunTestSuite) TestRun() {
4753 _ , createErr := suite .Fs .Create (validFilename .String ())
4854 suite .Require ().NoError (createErr )
4955
50- config := main.Config {Depth : math .MaxUint , Fs : suite .Fs , Fix : false , Paths : []files.Path {suite .Root }, Verbose : false }
56+ config := main.Config {
57+ Depth : math .MaxUint ,
58+ Fs : suite .Fs ,
59+ Fix : false ,
60+ Paths : []files.Path {suite .Root },
61+ Verbose : false ,
62+ }
5163 suite .Nil (main .Run (config ))
5264 })
5365 suite .Run ("fails with a single invalid file" , func () {
@@ -56,13 +68,25 @@ func (suite *RunTestSuite) TestRun() {
5668 _ , createErr := suite .Fs .Create (invalidFilename .String ())
5769 suite .Require ().NoError (createErr )
5870
59- config := main.Config {Depth : math .MaxUint , Fs : suite .Fs , Fix : false , Paths : []files.Path {suite .Root }, Verbose : false }
71+ config := main.Config {
72+ Depth : math .MaxUint ,
73+ Fs : suite .Fs ,
74+ Fix : false ,
75+ Paths : []files.Path {suite .Root },
76+ Verbose : false ,
77+ }
6078 suite .NotNil (main .Run (config ))
6179 })
6280 })
6381 suite .Run ("fix" , func () {
6482 suite .Run ("succeeds with an empty directory" , func () {
65- config := main.Config {Depth : math .MaxUint , Fs : suite .Fs , Fix : true , Paths : []files.Path {suite .Root }, Verbose : false }
83+ config := main.Config {
84+ Depth : math .MaxUint ,
85+ Fs : suite .Fs ,
86+ Fix : true ,
87+ Paths : []files.Path {suite .Root },
88+ Verbose : false ,
89+ }
6690 suite .Nil (main .Run (config ))
6791 })
6892 suite .Run ("succeeds with a single valid file" , func () {
@@ -71,7 +95,13 @@ func (suite *RunTestSuite) TestRun() {
7195 _ , createErr := suite .Fs .Create (validFilename .String ())
7296 suite .Require ().NoError (createErr )
7397
74- config := main.Config {Depth : math .MaxUint , Fs : suite .Fs , Fix : true , Paths : []files.Path {suite .Root }, Verbose : false }
98+ config := main.Config {
99+ Depth : math .MaxUint ,
100+ Fs : suite .Fs ,
101+ Fix : true ,
102+ Paths : []files.Path {suite .Root },
103+ Verbose : false ,
104+ }
75105 suite .Nil (main .Run (config ))
76106 })
77107 suite .Run ("succeeds with a single invalid file" , func () {
@@ -80,7 +110,13 @@ func (suite *RunTestSuite) TestRun() {
80110 _ , createErr := suite .Fs .Create (invalidFilename .String ())
81111 suite .Require ().NoError (createErr )
82112
83- config := main.Config {Depth : math .MaxUint , Fs : suite .Fs , Fix : true , Paths : []files.Path {suite .Root }, Verbose : false }
113+ config := main.Config {
114+ Depth : math .MaxUint ,
115+ Fs : suite .Fs ,
116+ Fix : true ,
117+ Paths : []files.Path {suite .Root },
118+ Verbose : false ,
119+ }
84120 suite .Nil (main .Run (config ))
85121 })
86122 suite .Run ("condenses separators into one underscore" , func () {
@@ -89,7 +125,13 @@ func (suite *RunTestSuite) TestRun() {
89125 _ , createErr := suite .Fs .Create (invalidFilename .String ())
90126 suite .Require ().NoError (createErr )
91127
92- config := main.Config {Depth : math .MaxUint , Fs : suite .Fs , Fix : true , Paths : []files.Path {suite .Root }, Verbose : false }
128+ config := main.Config {
129+ Depth : math .MaxUint ,
130+ Fs : suite .Fs ,
131+ Fix : true ,
132+ Paths : []files.Path {suite .Root },
133+ Verbose : false ,
134+ }
93135 suite .Nil (main .Run (config ))
94136 })
95137 })
0 commit comments