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 convenience info to `danger.git.diffForFile` #223

Merged
merged 13 commits into from Apr 15, 2017

Conversation

Projects
None yet
3 participants
@namuol
Member

namuol commented Apr 13, 2017

Fixes #221

Changes the signature for danger.git.diffForFile to the following:

/** All Text diff values will be this shape */
export interface TextDiff {
  /** The value before the PR's applied changes */
  before: string
  /** The value after the PR's applied changes */
  after: string,
  /** A string containing the full set of changes */
  diff: string,
  /** A string containing just the added lines */
  added: string,
  /** A string containing just the removed lines */
  removed: string
}

diffForFile(filename: string): Promise<TextDiff | null>

TODO

  • Update docs
  • Update changelog (include dangerfile migration instructions)
  • Run yarn declarations
  • Add tests
    • before
    • after
    • added
    • removed
  • Fix snapshot issues (?)
Show outdated Hide outdated source/dsl/GitDSL.ts
@codecov-io

This comment has been minimized.

Show comment
Hide comment
@codecov-io

codecov-io Apr 13, 2017

Codecov Report

Merging #223 into master will not change coverage.
The diff coverage is 92.3%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #223   +/-   ##
=======================================
  Coverage   68.62%   68.62%           
=======================================
  Files          34       34           
  Lines         765      765           
  Branches      105      104    -1     
=======================================
  Hits          525      525           
  Misses        240      240
Impacted Files Coverage Δ
source/platforms/FakePlatform.ts 68.42% <0%> (ø) ⬆️
source/platforms/github/GitHubGit.ts 98.27% <100%> (ø) ⬆️

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 d3f1933...82b089c. Read the comment docs.

codecov-io commented Apr 13, 2017

Codecov Report

Merging #223 into master will not change coverage.
The diff coverage is 92.3%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #223   +/-   ##
=======================================
  Coverage   68.62%   68.62%           
=======================================
  Files          34       34           
  Lines         765      765           
  Branches      105      104    -1     
=======================================
  Hits          525      525           
  Misses        240      240
Impacted Files Coverage Δ
source/platforms/FakePlatform.ts 68.42% <0%> (ø) ⬆️
source/platforms/github/GitHubGit.ts 98.27% <100%> (ø) ⬆️

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 d3f1933...82b089c. Read the comment docs.

@namuol

This comment has been minimized.

Show comment
Hide comment
@namuol

namuol Apr 13, 2017

Member

Hmm... I must be missing something. The tests are passing on my machine but AppVeyor doesn't seem to like it. 🤷‍♂️

Member

namuol commented Apr 13, 2017

Hmm... I must be missing something. The tests are passing on my machine but AppVeyor doesn't seem to like it. 🤷‍♂️

@orta

This comment has been minimized.

Show comment
Hide comment
@orta

orta Apr 14, 2017

Member

These failing snapshots feel backwards, like it's inverting the before and after

Member

orta commented Apr 14, 2017

These failing snapshots feel backwards, like it's inverting the before and after

@namuol

This comment has been minimized.

Show comment
Hide comment
@namuol

namuol Apr 14, 2017

Member

These failing snapshots feel backwards, like it's inverting the before and after

Yeah, the Jest output doesn't really make sense. It treats every line but the last as different, even though if you copy/paste the terminal output and do a diff after cleaning out the additional +/-s, they're identical.

Member

namuol commented Apr 14, 2017

These failing snapshots feel backwards, like it's inverting the before and after

Yeah, the Jest output doesn't really make sense. It treats every line but the last as different, even though if you copy/paste the terminal output and do a diff after cleaning out the additional +/-s, they're identical.

@orta

This comment has been minimized.

Show comment
Hide comment
@orta

orta Apr 14, 2017

Member

yeah, must be some invisible characters - can we strip them for the test?

Member

orta commented Apr 14, 2017

yeah, must be some invisible characters - can we strip them for the test?

@namuol

This comment has been minimized.

Show comment
Hide comment
@namuol

namuol Apr 14, 2017

Member

Yup. Stripping the whitespace seemed to fix the issue. I'll make this more explicit and add a TODO to the test file.

Member

namuol commented Apr 14, 2017

Yup. Stripping the whitespace seemed to fix the issue. I'll make this more explicit and add a TODO to the test file.

@orta

This comment has been minimized.

Show comment
Hide comment
@orta

orta Apr 14, 2017

Member

👍 Perfect

Member

orta commented Apr 14, 2017

👍 Perfect

@namuol

This comment has been minimized.

Show comment
Hide comment
@namuol

namuol Apr 14, 2017

Member

I'd wait for @alex3165's response, but otherwise does this look good?

Member

namuol commented Apr 14, 2017

I'd wait for @alex3165's response, but otherwise does this look good?

@orta

This comment has been minimized.

Show comment
Hide comment
@orta

orta Apr 14, 2017

Member

Yep, everything looks 👍

Member

orta commented Apr 14, 2017

Yep, everything looks 👍

@orta

This comment has been minimized.

Show comment
Hide comment
@orta

orta Apr 14, 2017

Member

will merge and release EOD tomorrow if we don't hear anything back

Member

orta commented Apr 14, 2017

will merge and release EOD tomorrow if we don't hear anything back

@orta

This comment has been minimized.

Show comment
Hide comment
@orta

orta Apr 14, 2017

Member

also, I've invited you to the org, as a part of Moya Community Continuity - you're welcome to participate (or not, we're chill) in PRs and help out at a level that works for you.

Member

orta commented Apr 14, 2017

also, I've invited you to the org, as a part of Moya Community Continuity - you're welcome to participate (or not, we're chill) in PRs and help out at a level that works for you.

@orta orta merged commit bcdb0ce into danger:master Apr 15, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment