Skip to content

feat(gnofmt): delete trailing whitespaces #4214

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

Closed
wants to merge 2 commits into from

Conversation

moul
Copy link
Member

@moul moul commented Apr 23, 2025

Context: was working on #4211 and noticed that make fmt and make test.sync aren't compatible...


This change may not be what we want, but I would like to propose it to gather opinions.

I believe that if we do not allow gnofmt to ignore trailing whitespaces, we should still expect this repository to adhere to this rule. Perhaps we could implement a second rule in "make fmt" that calls another binary.

  1. This creates inconsistency, which editors sometimes alter. As a result, we occasionally see changes occurring simply because someone opened a file in their editor.
  2. It also leads to strange behaviors with the auto-generated outputs in filetest. I prefer to address the problem at the source, but another option could be to ensure that filetest generates clean output.

In addition to reviewing my implementation, please share your thoughts.

@Gno2D2
Copy link
Collaborator

Gno2D2 commented Apr 23, 2025

🛠 PR Checks Summary

All Automated Checks passed. ✅

Manual Checks (for Reviewers):
  • IGNORE the bot requirements for this PR (force green CI check)
Read More

🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers.

✅ Automated Checks (for Contributors):

🟢 Maintainers must be able to edit this pull request (more info)

☑️ Contributor Actions:
  1. Fix any issues flagged by automated checks.
  2. Follow the Contributor Checklist to ensure your PR is ready for review.
    • Add new tests, or document why they are unnecessary.
    • Provide clear examples/screenshots, if necessary.
    • Update documentation, if required.
    • Ensure no breaking changes, or include BREAKING CHANGE notes.
    • Link related issues/PRs, where applicable.
☑️ Reviewer Actions:
  1. Complete manual checks for the PR, including the guidelines and additional checks if applicable.
📚 Resources:
Debug
Automated Checks
Maintainers must be able to edit this pull request (more info)

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 The base branch matches this pattern: ^master$
    └── 🟢 The pull request was created from a fork (head branch repo: moul/gno)

Then

🟢 Requirement satisfied
└── 🟢 Maintainer can modify this pull request

Manual Checks
**IGNORE** the bot requirements for this PR (force green CI check)

If

🟢 Condition met
└── 🟢 On every pull request

Can be checked by

  • Any user with comment edit permission

@github-actions github-actions bot added the 🧾 package/realm Tag used for new Realms or Packages. label Apr 23, 2025
@moul moul marked this pull request as ready for review April 23, 2025 16:57
@moul moul requested review from thehowl, aeddi, mvertes and gfanton April 23, 2025 16:58
Copy link

codecov bot commented Apr 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@jaekwon
Copy link
Contributor

jaekwon commented Apr 24, 2025

I don't think it's a good idea because it manipulates strings. See examples/gno.land/r/mouss/home/home.gno.
Does this have to do with filetest .Sync? There's some regression in the way directives are parsed and/or printed. The previous version had issues too, making too many directives. If you show me exactly how to replicate the problem (e.g. which file) then I can try to fix it in filetests directives handling.

But this fix doesn't work because it manipulates declared string constants.

@moul moul closed this Apr 28, 2025
@github-project-automation github-project-automation bot moved this from 📥 Inbox to ✅ Done in 😎 Manfred's Board Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 🤖 gnovm Issues or PRs gnovm related 🧾 package/realm Tag used for new Realms or Packages.
Projects
Status: Done
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

3 participants