Skip to content

Conversation

Pantani
Copy link
Collaborator

@Pantani Pantani commented May 6, 2025

use the xast package to add params into a struct inside a function will add a new param in the same line of the last parameter, causing a bad indetation. This PR fix this issue add a new parameter for each new line

eg:

	k := Keeper{
		storeService: storeService,
		cdc:          cdc,
		addressCodec: addressCodec,
		authority:    authority,

		Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)), TestListSeq: collections.NewSequence(sb, types.TestListCountKey, "testListSequence"), TestList: collections.NewMap(sb, types.TestListKey, "testList", collections.Uint64Key, codec.CollValue[types.TestList](cdc)), TestMap: collections.NewMap(sb, types.TestMapKey, "testMap", collections.StringKey, codec.CollValue[types.TestMap](cdc)), TestSingle: collections.NewItem(sb, types.TestSingleKey, "testSingle", codec.CollValue[types.TestSingle](cdc)),
	}

Expected:

	k := Keeper{
		storeService: storeService,
		cdc:          cdc,
		addressCodec: addressCodec,
		authority:    authority,

		Params:   collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)),
		TestList: collections.NewMap(sb, types.TestListKey, "testList", collections.Uint64Key, codec.CollValue[types.TestList](cdc)), TestListSeq: collections.NewSequence(sb, types.TestListCountKey, "testListSequence"),
		TestMap:    collections.NewMap(sb, types.TestMapKey, "testMap", collections.StringKey, codec.CollValue[types.TestMap](cdc)),
		TestSingle: collections.NewItem(sb, types.TestSingleKey, "testSingle", codec.CollValue[types.TestSingle](cdc)),
	}

@Pantani Pantani self-assigned this May 6, 2025
@github-actions github-actions bot added component:ci CI/CD workflow and automated jobs. component:configs component:packages labels May 6, 2025
@Pantani Pantani requested review from salmad3 and toschdev as code owners May 6, 2025 16:42
@Pantani Pantani marked this pull request as draft May 6, 2025 16:49
@Pantani Pantani marked this pull request as ready for review May 7, 2025 03:49
@julienrbrt
Copy link
Member

julienrbrt commented May 7, 2025

Looks like it fails before of a misplaced comment:
image
https://github.com/ignite/cli/actions/runs/14886377325/job/41806955815?pr=4658

@Pantani Pantani force-pushed the fix/scaffold-struct-param branch from 977d355 to be57b58 Compare May 8, 2025 03:43
@julienrbrt julienrbrt enabled auto-merge (squash) May 8, 2025 08:05
@julienrbrt julienrbrt merged commit 62c0ab9 into main May 8, 2025
43 checks passed
@julienrbrt julienrbrt deleted the fix/scaffold-struct-param branch May 8, 2025 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants