From d6116c15984689c5acbe228d43cb491ce6e57166 Mon Sep 17 00:00:00 2001 From: Chase Fleming <1666730+chasefleming@users.noreply.github.com> Date: Wed, 7 Feb 2024 10:41:05 -0800 Subject: [PATCH] Format boilerplat access modifiers --- internal/super/generate.go | 6 ++++-- internal/super/generate_test.go | 9 ++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/internal/super/generate.go b/internal/super/generate.go index b60f4ca09..5837819ab 100644 --- a/internal/super/generate.go +++ b/internal/super/generate.go @@ -157,11 +157,13 @@ func generateNew( switch templateType { case "contract": fileToWrite = fmt.Sprintf(` -access(all) contract %s { +access(all) +contract %s { init() {} }`, name) case "script": - fileToWrite = `access(all) fun main() { + fileToWrite = `access(all) +fun main() { // Script details here }` case "transaction": diff --git a/internal/super/generate_test.go b/internal/super/generate_test.go index 6183fbf6a..dbf1e274d 100644 --- a/internal/super/generate_test.go +++ b/internal/super/generate_test.go @@ -51,7 +51,8 @@ func TestGenerateNewContract(t *testing.T) { // Check content is correct expectedContent := ` -access(all) contract TestContract { +access(all) +contract TestContract { init() {} }` assert.Equal(t, expectedContent, string(fileContent)) @@ -129,7 +130,8 @@ func TestGenerateNewScript(t *testing.T) { assert.NoError(t, err, "Failed to read generated file") assert.NotNil(t, content) - expectedContent := `access(all) fun main() { + expectedContent := `access(all) +fun main() { // Script details here }` assert.Equal(t, expectedContent, string(content)) @@ -185,7 +187,8 @@ func TestGenerateNewWithDirFlag(t *testing.T) { assert.NotNil(t, content) expectedContent := ` -access(all) contract TestContract { +access(all) +contract TestContract { init() {} }` assert.Equal(t, expectedContent, string(content))