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

fix: prettier format files #1369

Merged
merged 1 commit into from
Jun 17, 2022
Merged

fix: prettier format files #1369

merged 1 commit into from
Jun 17, 2022

Conversation

emersonlaurentino
Copy link
Member

What's the purpose of this pull request?

Prettier was configured and some files need to be formatted

How it works?

All files will formatted following prettier config

How to test it?

Starters Deploy Preview

References

@emersonlaurentino emersonlaurentino self-assigned this Jun 17, 2022
@emersonlaurentino emersonlaurentino requested a review from a team as a code owner June 17, 2022 15:10
@vercel
Copy link

vercel bot commented Jun 17, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
faststore ✅ Ready (Inspect) Visit Preview Jun 17, 2022 at 6:23PM (UTC)

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 17, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 1101cd0:

Sandbox Source
Store UI Typescript Configuration

Copy link
Contributor

@filipewl filipewl left a comment

Choose a reason for hiding this comment

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

Nice! I think it's a nice opportunity for us to use Git's feature of ignoring commits in the blame view so all this automatic formatting changes don't clutter the blame view of a file, obfuscating important commit information. What do you think? You can find information in this GH Doc.
https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view

Base automatically changed from feat/lint to main June 17, 2022 17:52
Copy link
Member

@eduardoformiga eduardoformiga left a comment

Choose a reason for hiding this comment

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

💯 !

@emersonlaurentino emersonlaurentino merged commit 7f42ea9 into main Jun 17, 2022
@emersonlaurentino emersonlaurentino deleted the fix/format branch June 17, 2022 18:20
filipewl pushed a commit that referenced this pull request Jul 20, 2022
## What's the purpose of this pull request?

```
🧹  This is more for Git housekeeping than the FastStore itself.
```

Create a `.git-blame-ignore-revs` file to list commits that should be ignored from the blame view. This is useful to remove the noise introduced by aesthetic changes such as code formatting: when viewing the blame for a file, we can omit commits that only changed formatting/indentation so we can quickly see what matters.

I had [mentioned](#1369 (review)) that #1369 was a good candidate to test this feature (that is relatively new in GH, not Git itself).

## How does it work?

By adding a commit SHA/ID to be ignored in the `.git-blame-ignore-revs` file.

## How to test it?

See how on _Before_ the changes from the commit "fix: prettier format files", which were only formatting, hid the original blame lines. On _After_ they're restored because that commit is ignored.

[Before](https://github.com/vtex/faststore/blame/5aa3958cbbfd2177c691406d147bd4bc6d08c8f1/packages/api/src/platforms/vtex/index.ts)|[After](https://github.com/vtex/faststore/blame/ea45a50eb14eee131526359b18cc9e3da945175f/packages/api/src/platforms/vtex/index.ts)
-|-
![CleanShot 2022-07-19 at 20 35 02@2x](https://user-images.githubusercontent.com/381395/179865670-abe9f1f2-8acb-42a9-adbe-5b483049dd1a.png)|![CleanShot 2022-07-19 at 20 35 11@2x](https://user-images.githubusercontent.com/381395/179865649-89146a8f-e95b-4896-a4b3-6681d95e254d.png)

## References

- [GH Docs - Ignore commits in the blame view](https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view)
- [GH Community - Support --ignore-revs-file for blame view to support automated code formatters](community/community#5033)
- [Blog - A better git blame with --ignore-rev](https://www.michaelheap.com/git-ignore-rev/)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants