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

feat: support matchStandaloneSnapshot #102

Merged
merged 4 commits into from
Jul 28, 2024
Merged

Conversation

gkampitakis
Copy link
Owner

@gkampitakis gkampitakis commented Jul 7, 2024

Closes #100

  • Backward compatible
  • Test edge cases
  • Update docs
  • Unit testing
  • Can we drop code duplication

Note

The new method can show false positives for obsolete files when using snaps.Skip* or -run.
Also similarly to other methods if the file is the last in a directory and it's obsolete go-snaps won't mark it as obsolete as it can't discover it.

@gkampitakis gkampitakis force-pushed the matchStandaloneSnapshot branch 2 times, most recently from d94c65a to 63da2c9 Compare July 8, 2024 21:24
@gkampitakis gkampitakis force-pushed the matchStandaloneSnapshot branch 2 times, most recently from b8702af to f0114f8 Compare July 20, 2024 19:52
@gkampitakis gkampitakis changed the title initial commit feat: support matchStandaloneSnapshot Jul 20, 2024
@jeremyhcho
Copy link

Hi @gkampitakis!

Thanks for putting this together. I was in the midst of looking for a way to save snapshot files with a .json extension and found your PR :)

Do you have a timeline around releasing this change?

Thanks again!

@gkampitakis
Copy link
Owner Author

Hi @gkampitakis!

Thanks for putting this together. I was in the midst of looking for a way to save snapshot files with a .json extension and found your PR :)

Do you have a timeline around releasing this change?

Thanks again!

Hey @jeremyhcho, thanks for your interest. I have been quite busy this week, but hopefully I will make progress and manage to merge it this weekend if I don't encounter any issue as this pr is mostly done 😄 . If you want to test it and provide any feedback you are welcome to try it with

go get github.com/gkampitakis/go-snaps@matchStandaloneSnapshot

@gkampitakis gkampitakis marked this pull request as ready for review July 26, 2024 19:48
@gkampitakis gkampitakis merged commit 2fadb85 into main Jul 28, 2024
4 checks passed
@gkampitakis gkampitakis deleted the matchStandaloneSnapshot branch July 28, 2024 17:37
hogo6002 pushed a commit to google/osv-scanner that referenced this pull request Jul 29, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[github.com/gkampitakis/go-snaps](https://togithub.com/gkampitakis/go-snaps)
| `v0.5.5` -> `v0.5.6` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fgkampitakis%2fgo-snaps/v0.5.6?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fgkampitakis%2fgo-snaps/v0.5.6?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fgkampitakis%2fgo-snaps/v0.5.5/v0.5.6?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fgkampitakis%2fgo-snaps/v0.5.5/v0.5.6?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [github.com/urfave/cli/v2](https://togithub.com/urfave/cli) |
`v2.27.2` -> `v2.27.3` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2furfave%2fcli%2fv2/v2.27.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2furfave%2fcli%2fv2/v2.27.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2furfave%2fcli%2fv2/v2.27.2/v2.27.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2furfave%2fcli%2fv2/v2.27.2/v2.27.3?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>gkampitakis/go-snaps
(github.com/gkampitakis/go-snaps)</summary>

###
[`v0.5.6`](https://togithub.com/gkampitakis/go-snaps/releases/tag/v0.5.6)

[Compare
Source](https://togithub.com/gkampitakis/go-snaps/compare/v0.5.5...v0.5.6)

#### What's Changed

- feat: support matchStandaloneSnapshot by
[@&#8203;gkampitakis](https://togithub.com/gkampitakis) in
[gkampitakis/go-snaps#102
- feat: support setting file extension by
[@&#8203;gkampitakis](https://togithub.com/gkampitakis) in
[gkampitakis/go-snaps#102

**Full Changelog**:
gkampitakis/go-snaps@v0.5.5...v0.5.6

</details>

<details>
<summary>urfave/cli (github.com/urfave/cli/v2)</summary>

### [`v2.27.3`](https://togithub.com/urfave/cli/releases/tag/v2.27.3)

[Compare
Source](https://togithub.com/urfave/cli/compare/v2.27.2...v2.27.3)

#### What's Changed

- v2 Docs: Mention value from env as default value by
[@&#8203;sj14](https://togithub.com/sj14) in
[urfave/cli#1910
- Bump github.com/xrash/smetrics dependency by
[@&#8203;elezar](https://togithub.com/elezar) in
[urfave/cli#1911
- fix: disable bash completion if double dash is included in arguments
(v2) by [@&#8203;suzuki-shunsuke](https://togithub.com/suzuki-shunsuke)
in
[urfave/cli#1938
- Fix improper whitespace formatting in usageTemplate, AppHelpTemplate …
by [@&#8203;caeret](https://togithub.com/caeret) in
[urfave/cli#1947

#### New Contributors

- [@&#8203;sj14](https://togithub.com/sj14) made their first
contribution in
[urfave/cli#1910
- [@&#8203;elezar](https://togithub.com/elezar) made their first
contribution in
[urfave/cli#1911
- [@&#8203;caeret](https://togithub.com/caeret) made their first
contribution in
[urfave/cli#1947

**Full Changelog**:
urfave/cli@v2.27.2...v2.27.3

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 6am on monday" in timezone
Australia/Sydney, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View the
[repository job
log](https://developer.mend.io/github/google/osv-scanner).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=-->
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.

Questions about effectively using go-snaps
2 participants