@@ -45,8 +45,8 @@ func Test_Lint(t *testing.T) {
4545 })
4646
4747 t .Run ("lints file with no issues" , func (t * testing.T ) {
48- t .Parallel ()
4948 state := setupMockState (t )
49+ t .Parallel ()
5050
5151 results , err := lintFiles (state , false , "NoError.cdc" )
5252 require .NoError (t , err )
@@ -66,8 +66,8 @@ func Test_Lint(t *testing.T) {
6666 })
6767
6868 t .Run ("lints file with import" , func (t * testing.T ) {
69- t .Parallel ()
7069 state := setupMockState (t )
70+ t .Parallel ()
7171
7272 results , err := lintFiles (state , false , "foo/WithImports.cdc" )
7373 require .NoError (t , err )
@@ -88,8 +88,8 @@ func Test_Lint(t *testing.T) {
8888 })
8989
9090 t .Run ("lints multiple files" , func (t * testing.T ) {
91- t .Parallel ()
9291 state := setupMockState (t )
92+ t .Parallel ()
9393
9494 results , err := lintFiles (state , false , "NoError.cdc" , "foo/WithImports.cdc" )
9595 require .NoError (t , err )
@@ -113,8 +113,8 @@ func Test_Lint(t *testing.T) {
113113 })
114114
115115 t .Run ("lints file with warning" , func (t * testing.T ) {
116- t .Parallel ()
117116 state := setupMockState (t )
117+ t .Parallel ()
118118
119119 results , err := lintFiles (state , false , "LintWarning.cdc" )
120120 require .NoError (t , err )
@@ -158,8 +158,8 @@ func Test_Lint(t *testing.T) {
158158 })
159159
160160 t .Run ("lints file with error" , func (t * testing.T ) {
161- t .Parallel ()
162161 state := setupMockState (t )
162+ t .Parallel ()
163163
164164 results , err := lintFiles (state , false , "LintError.cdc" )
165165 require .NoError (t , err )
@@ -199,8 +199,8 @@ func Test_Lint(t *testing.T) {
199199 })
200200
201201 t .Run ("generates synthetic replacement for replacement category diagnostics" , func (t * testing.T ) {
202- t .Parallel ()
203202 state := setupMockState (t )
203+ t .Parallel ()
204204
205205 results , err := lintFiles (state , false , "ReplacementHint.cdc" )
206206 require .NoError (t , err )
@@ -225,8 +225,8 @@ func Test_Lint(t *testing.T) {
225225 })
226226
227227 t .Run ("linter resolves imports from flowkit state" , func (t * testing.T ) {
228- t .Parallel ()
229228 state := setupMockState (t )
229+ t .Parallel ()
230230
231231 results , err := lintFiles (state , false , "WithFlowkitImport.cdc" )
232232 require .NoError (t , err )
@@ -246,8 +246,8 @@ func Test_Lint(t *testing.T) {
246246 })
247247
248248 t .Run ("resolves stdlib imports contracts" , func (t * testing.T ) {
249- t .Parallel ()
250249 state := setupMockState (t )
250+ t .Parallel ()
251251
252252 results , err := lintFiles (state , false , "StdlibImportsContract.cdc" )
253253 require .NoError (t , err )
@@ -279,8 +279,8 @@ func Test_Lint(t *testing.T) {
279279 })
280280
281281 t .Run ("resolves stdlib imports transactions" , func (t * testing.T ) {
282- t .Parallel ()
283282 state := setupMockState (t )
283+ t .Parallel ()
284284
285285 results , err := lintFiles (state , false , "StdlibImportsTransaction.cdc" )
286286 require .NoError (t , err )
@@ -312,8 +312,8 @@ func Test_Lint(t *testing.T) {
312312 })
313313
314314 t .Run ("resolves stdlib imports scripts" , func (t * testing.T ) {
315- t .Parallel ()
316315 state := setupMockState (t )
316+ t .Parallel ()
317317
318318 results , err := lintFiles (state , false , "StdlibImportsScript.cdc" )
319319 require .NoError (t , err )
@@ -333,8 +333,8 @@ func Test_Lint(t *testing.T) {
333333 })
334334
335335 t .Run ("resolves stdlib imports Crypto" , func (t * testing.T ) {
336- t .Parallel ()
337336 state := setupMockState (t )
337+ t .Parallel ()
338338
339339 results , err := lintFiles (state , false , "StdlibImportsCrypto.cdc" )
340340 require .NoError (t , err )
@@ -354,8 +354,8 @@ func Test_Lint(t *testing.T) {
354354 })
355355
356356 t .Run ("resolves nested imports when contract imported by name" , func (t * testing.T ) {
357- t .Parallel ()
358357 state := setupMockState (t )
358+ t .Parallel ()
359359
360360 results , err := lintFiles (state , false , "TransactionImportingContractWithNestedImports.cdc" )
361361 require .NoError (t , err )
@@ -375,8 +375,8 @@ func Test_Lint(t *testing.T) {
375375 })
376376
377377 t .Run ("allows access(account) when contracts on same account" , func (t * testing.T ) {
378- t .Parallel ()
379378 state := setupMockStateWithAccountAccess (t )
379+ t .Parallel ()
380380
381381 results , err := lintFiles (state , false , "ContractA.cdc" )
382382 require .NoError (t , err )
@@ -397,8 +397,8 @@ func Test_Lint(t *testing.T) {
397397 })
398398
399399 t .Run ("denies access(account) when contracts on different accounts" , func (t * testing.T ) {
400- t .Parallel ()
401400 state := setupMockStateWithAccountAccess (t )
401+ t .Parallel ()
402402
403403 results , err := lintFiles (state , false , "ContractC.cdc" )
404404 require .NoError (t , err )
@@ -412,8 +412,8 @@ func Test_Lint(t *testing.T) {
412412 })
413413
414414 t .Run ("allows access(account) when dependencies on same account (peak-money repro)" , func (t * testing.T ) {
415- t .Parallel ()
416415 state := setupMockStateWithDependencies (t )
416+ t .Parallel ()
417417
418418 results , err := lintFiles (state , false , "imports/testaddr/DepA.cdc" )
419419 require .NoError (t , err )
@@ -434,8 +434,8 @@ func Test_Lint(t *testing.T) {
434434 })
435435
436436 t .Run ("allows access(account) when dependencies have Source but no Aliases" , func (t * testing.T ) {
437- t .Parallel ()
438437 state := setupMockStateWithSourceOnly (t )
438+ t .Parallel ()
439439
440440 // Verify that AddDependencyAsContract automatically adds Source to Aliases
441441 sourceAContract , _ := state .Contracts ().ByName ("SourceA" )
@@ -466,6 +466,7 @@ func Test_Lint(t *testing.T) {
466466}
467467
468468func setupMockState (t * testing.T ) * flowkit.State {
469+ t .Helper ()
469470 // Mock file system
470471 mockFs := afero .NewMemMapFs ()
471472 _ = afero .WriteFile (mockFs , "NoError.cdc" , []byte (`
@@ -615,6 +616,7 @@ func setupMockState(t *testing.T) *flowkit.State {
615616}
616617
617618func setupMockStateWithAccountAccess (t * testing.T ) * flowkit.State {
619+ t .Helper ()
618620 // Mock file system
619621 mockFs := afero .NewMemMapFs ()
620622
@@ -702,6 +704,7 @@ func setupMockStateWithAccountAccess(t *testing.T) *flowkit.State {
702704}
703705
704706func setupMockStateWithDependencies (t * testing.T ) * flowkit.State {
707+ t .Helper ()
705708 // Reproduce peak-money structure: dependencies with aliases, not contracts
706709 mockFs := afero .NewMemMapFs ()
707710
@@ -801,6 +804,7 @@ func setupMockStateWithDependencies(t *testing.T) *flowkit.State {
801804}
802805
803806func setupMockStateWithSourceOnly (t * testing.T ) * flowkit.State {
807+ t .Helper ()
804808 // Test dependencies with ONLY Source (no Aliases) to see if we need to check Source
805809 mockFs := afero .NewMemMapFs ()
806810
0 commit comments