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

forge fmt removes newline from the end of each file #2667

Closed
2 tasks done
CodeSandwich opened this issue Aug 9, 2022 · 3 comments
Closed
2 tasks done

forge fmt removes newline from the end of each file #2667

CodeSandwich opened this issue Aug 9, 2022 · 3 comments
Labels
C-forge Command: forge Cmd-forge-fmt Command: forge fmt T-bug Type: bug
Milestone

Comments

@CodeSandwich
Copy link
Contributor

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (63ed109 2022-08-09T00:03:50.892098571Z)

What command(s) is the bug in?

forge fmt

Operating System

Linux

Describe the bug

forge fmt leaves all .sol files without the newline at the end. This makes them non-conformant with POSIX definition of lines of text. It also conflicts with many tools like text editors, which automatically insert the newline at the end of each file. Various code displaying tools like gitk also treat lack of the newline as an anomaly which needs to be explicitly highlighted, which generates noise.

@CodeSandwich CodeSandwich added the T-bug Type: bug label Aug 9, 2022
@gakonst
Copy link
Member

gakonst commented Aug 9, 2022

interesting - cc @rkrasiuk , should we maybe make this on by default and strip if specified in cfg?

@onbjerg onbjerg added C-forge Command: forge Cmd-forge-fmt Command: forge fmt labels Aug 9, 2022
@onbjerg onbjerg added this to the v1.0.0 milestone Aug 9, 2022
@rkrasiuk
Copy link
Collaborator

hmm, this looks like a regression. it was addressed in #2177

@gakonst
Copy link
Member

gakonst commented Aug 10, 2022

fixed in #2690

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-forge Command: forge Cmd-forge-fmt Command: forge fmt T-bug Type: bug
Projects
No open projects
Archived in project
Development

No branches or pull requests

4 participants