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

fix: Fix incorrect ratchet behavior on relative source path #49

Merged
merged 3 commits into from
May 10, 2021

Conversation

slarse
Copy link
Collaborator

@slarse slarse commented May 7, 2021

Fix #47

When the source path (i.e. the one given as input to runSorald) is relative, the matching between violation specifiers and changed code doesn't work (as the diff filepaths are absolute).

This PR fixes this by resolving the absolute path to the source in runSorald.

Note that there's now quite a lot of repetition in the main.test.ts test module. I intend to fix that with a separate refactoring, see #48.

@codecov
Copy link

codecov bot commented May 7, 2021

Codecov Report

Merging #49 (939f89c) into main (70d81bc) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #49      +/-   ##
==========================================
+ Coverage   93.37%   93.40%   +0.03%     
==========================================
  Files           6        6              
  Lines         181      182       +1     
  Branches       18       18              
==========================================
+ Hits          169      170       +1     
  Misses         11       11              
  Partials        1        1              
Impacted Files Coverage Δ
src/main.ts 92.85% <100.00%> (+0.10%) ⬆️

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 70d81bc...939f89c. Read the comment docs.

Copy link
Member

@algomaster99 algomaster99 left a comment

Choose a reason for hiding this comment

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

Just one small change and then we can decide to merge.

src/main.ts Outdated Show resolved Hide resolved
@slarse slarse requested a review from algomaster99 May 10, 2021 06:21
Copy link
Member

@algomaster99 algomaster99 left a comment

Choose a reason for hiding this comment

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

Shall we merge now?

@slarse
Copy link
Collaborator Author

slarse commented May 10, 2021

@algomaster99 Yep :)

@algomaster99 algomaster99 merged commit 35c1a78 into main May 10, 2021
@algomaster99 algomaster99 deleted the issue/47-fix-ratchet-from-on-spoon branch May 10, 2021 06:28
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.

ratchet-from doesn't work on real project
2 participants