Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

feat: trailing commas #224

Merged
merged 2 commits into from
May 8, 2024
Merged

Conversation

novusnota
Copy link
Member

  • struct instantiations
  • initOf arguments
  • init() parameters
  • inherited traits via with
  • function arguments and parameters

Closes #164

* struct instantiations
* initOf arguments
* init() parameters
* inherited traits via with
* function arguments and parameters
@novusnota novusnota requested a review from anton-trunov May 8, 2024 11:50
Copy link
Member

@anton-trunov anton-trunov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, but most changes look irrelevant to me. We should promote a reasonable code style: using trailing commas only if the parameters, arguments, etc. are placed on separate lines, which usually happens when there is a lot of them or if the current indentation level is too deep. Otherwise trailing commas should not be used.

@novusnota
Copy link
Member Author

novusnota commented May 8, 2024

Oh, okay, that's reasonable. I'll try to leave explicit mentions of them on contract, functions and expressions pages and remove implicit usage elsewhere. Thinking of leaving them be for with lists though, but maybe not.

UPD: Came up with a consistent formatting approach — just match Dart's style, which is, implicitly, your recommendation as well. Trailing commas imply separate line formatting, while not having them keeps stuff on the same line.

And come up with some nice and consistent styling options
@novusnota novusnota requested a review from anton-trunov May 8, 2024 13:19
Copy link
Member

@anton-trunov anton-trunov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@anton-trunov anton-trunov merged commit 8854c30 into tact-lang:main May 8, 2024
1 of 2 checks passed
@anton-trunov
Copy link
Member

@novusnota I updated the list of checks for the linter issue: tact-lang/tact#295

@novusnota novusnota deleted the trailing-comma branch May 8, 2024 14:23
@novusnota
Copy link
Member Author

Awesome!

@novusnota novusnota modified the milestone: v1.3.0 May 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document trailing commas in all comma-separated lists
2 participants