Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added initial version of the formatter #74

Merged
merged 19 commits into from
Jun 14, 2021
Merged

Added initial version of the formatter #74

merged 19 commits into from
Jun 14, 2021

Conversation

leviathanbeak
Copy link
Contributor

No description provided.

@leviathanbeak leviathanbeak requested review from adlerjohn and sezna June 5, 2021 08:25
@adlerjohn adlerjohn added the forc label Jun 5, 2021
@adlerjohn adlerjohn changed the title Added initial version of the Fromatter for Swaylang Added initial version of the formatter Jun 5, 2021
Copy link
Contributor

@adlerjohn adlerjohn left a comment

Choose a reason for hiding this comment

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

  1. On my IDE, the indent size seems to be 2, despite being configured to be 4? Can you default it to 4 for the time being, until we have a .forcfmt.toml file. This was an IDE config issue on my end.
  2. In a future PR (or maybe this one, actually), add a forc fmt command to run formatting without having to use an IDE. (Command-line formatter #80)
  3. Bug: running formatting seems to be semantically destructive. If I write some random invalid syntax (e.g. change a bool to aool, instead of showing a compile error, the formatter clobbers the file and writes the latest valid file. This needs to be fixed in this PR.

@leviathanbeak
Copy link
Contributor Author

@adlerjohn for 1. that is really weird, I am using IDE settings directly so whatever is set in your IDE Settings that is the indentation that's used in the formatter,

as for other two things, I'll try to add/fix by tomorrow

@adlerjohn
Copy link
Contributor

@leviathanbeak well (1) will go away once we have a forcfmt.toml, so not a big deal.

@leviathanbeak
Copy link
Contributor Author

@adlerjohn I have fixed the sync bug you reported

@adlerjohn adlerjohn mentioned this pull request Jun 14, 2021
26 tasks
@leviathanbeak leviathanbeak requested a review from adlerjohn June 14, 2021 14:58
@adlerjohn adlerjohn mentioned this pull request Jun 14, 2021
@leviathanbeak leviathanbeak merged commit 8008f1b into master Jun 14, 2021
@leviathanbeak leviathanbeak deleted the formatter branch June 14, 2021 16:28
kayagokalp pushed a commit that referenced this pull request Aug 3, 2023
This reverts commit 688f10a, a commit
accidentally pushed from CI while testing #73.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants