Skip to content

Add a lineReader to provide two-line lookahead #56

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

Merged
merged 4 commits into from
Sep 29, 2020

Conversation

mrnugget
Copy link
Contributor

No description provided.

Copy link
Member

@eseliger eseliger left a comment

Choose a reason for hiding this comment

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

Cool, makes sense to me to look two lines ahead.

@codecov
Copy link

codecov bot commented Sep 28, 2020

Codecov Report

Merging #56 into master will increase coverage by 0.49%.
The diff coverage is 90.32%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #56      +/-   ##
==========================================
+ Coverage   74.10%   74.59%   +0.49%     
==========================================
  Files           4        4              
  Lines         421      437      +16     
==========================================
+ Hits          312      326      +14     
- Misses         62       63       +1     
- Partials       47       48       +1     
Impacted Files Coverage Δ
diff/reader_util.go 84.84% <85.00%> (+0.23%) ⬆️
diff/parse.go 81.25% <100.00%> (+0.08%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 837bd65...deb8e40. Read the comment docs.

@mrnugget mrnugget changed the base branch from mrnugget/fix-non-extended-file-header-parsing to master September 28, 2020 17:26
Copy link
Member

@keegancsmith keegancsmith left a comment

Choose a reason for hiding this comment

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

I still feel a bit iffy about error conditions here, but its a clear improvement over previous code. Great thing is we have a great test case that is sourcegraph.com, so in practice this is fine :D

@mrnugget
Copy link
Contributor Author

Great thing is we have a great test case that is sourcegraph.com, so in practice this is fine :D

That's the spirit!

I want to add more tests to this PR to check for more conditions. I also think it makes sense to add a more integration-level test here that makes sure that a huge diff can be parsed correctly. We have unit tests for the subparts, but I think a test that checks for multi-file diffs, including hunk contents, is missing.

@mrnugget mrnugget marked this pull request as ready for review September 29, 2020 11:27
@mrnugget mrnugget merged commit 5bc20c4 into master Sep 29, 2020
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.

3 participants