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

Add validation for parsed files #12

Open
bluekeyes opened this issue May 4, 2020 · 0 comments
Open

Add validation for parsed files #12

bluekeyes opened this issue May 4, 2020 · 0 comments
Labels
enhancement New feature or request parsing Issues related to parsing patches

Comments

@bluekeyes
Copy link
Owner

If a patch is malformed or a File is created directly, various fields may disagree. Add a validate function that checks for these types of issues so clients (e.g. appliers) can rely on the content of the fields.

Some of the issues to check:

  • IsRename is true/false but OldName and NewName are equal/not equal
  • IsDelete or IsNew is true but there is more than one fragment
  • IsDelete is true but the single fragment has context or addition lines or NewPosition and NewLines are not 0
  • IsNew is true but the single fragment has context or deletion lines or OldPosition and OldLines are not 0
  • IsBinary is true but TextFragments is not empty
@bluekeyes bluekeyes added enhancement New feature or request parsing Issues related to parsing patches labels May 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request parsing Issues related to parsing patches
Projects
None yet
Development

No branches or pull requests

1 participant