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

Do not create artifical name for extension-only filenames #726

Merged

Conversation

JanKrivanek
Copy link
Contributor

Problem

Verification of files that starts with dot (e.g. .editorconfig) generates/uses snapshots which prepend nofilename to the tested file. This is a minor inconvenience - discussed here: #699 (comment)

Solution

filename is preserved as empty
directory structure is preserved as well
appropriate tests added

Note

Potentially similar approach might be taken for files without extensions (currently artifical .noextension extension appended). This would require some changes in EmptyFiles as well (to support empty extension). I'm leaving it for separate work if it ever becomes concern for anyone.

@SimonCropp
Copy link
Member

so this is a breaking change?

@JanKrivanek
Copy link
Contributor Author

so this is a breaking change?

That's correct.
More precisely:

  • For updates from >= 18.3.1-beta.1 it's breaking
  • For updates from <= 18.3.0 it's actualy enabling the upgrade without the breaking change that's currently imposed (as previously the 'dot filename' that was contained within some subdirectory was supported as is and in newer version the snapshot name is altered)

We are currently in the second category (trying to prevent sequence of 2 breaking changes)

@SimonCropp
Copy link
Member

do u think it makes sense for this to handle deletion of the legacy file?

if no can u add a section in the description for how people can manually clean up

@JanKrivanek
Copy link
Contributor Author

Good point.
Will look into that and update.

@JanKrivanek
Copy link
Contributor Author

@SimonCropp I update the PR to rename the snapshots from previous naming convention (simple cleanup of previous naming convention is in previous commit - if that feels as better strategy). Let me know what are your thoughts on that.
Thanks!

@SimonCropp SimonCropp added this to the 19.2.0 milestone Nov 27, 2022
@SimonCropp SimonCropp merged commit 5332f6b into VerifyTests:main Nov 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

2 participants