wakatime / wakatime-cli

Command line interface used by all WakaTime text editor plugins
https://wakatime.com/plugins
BSD 3-Clause "New" or "Revised" License
277 stars 41 forks source link

Count lines changed for current file #946

Closed gandarez closed 8 months ago

gandarez commented 1 year ago

This PR adds a feature to count lines changed for a specific file if rev control is Git.

Steps to tests:

  1. Build wakatime-cli with make
  2. Change any file inside a git repository
  3. Call ./build/wakatime-cli* --entity "/path/to/changed_file" --log-to-stdout --verbose
  4. It should print an array of heartbeats and the first element must contain lines_added and lines_removed fields
  5. It should sync activity

Closes #609

codecov[bot] commented 11 months ago

Codecov Report

Merging #946 (83fa606) into develop (36f6372) will increase coverage by 0.06%. The diff coverage is 73.91%.

:exclamation: Current head 83fa606 differs from pull request most recent head f6cb5d8. Consider uploading reports for the commit f6cb5d8 to get more accurate results

@@             Coverage Diff             @@
##           develop     #946      +/-   ##
===========================================
+ Coverage    62.36%   62.43%   +0.06%     
===========================================
  Files          372      373       +1     
  Lines        15660    15751      +91     
===========================================
+ Hits          9767     9834      +67     
- Misses        5366     5386      +20     
- Partials       527      531       +4     
Flag Coverage Δ
unittests 62.43% <73.91%> (+0.06%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
cmd/params/params.go 85.94% <100.00%> (ø)
pkg/heartbeat/heartbeat.go 86.95% <ø> (ø)
pkg/project/project.go 88.50% <100.00%> (+0.31%) :arrow_up:
pkg/git/git.go 75.00% <75.00%> (ø)
pkg/project/git.go 61.66% <65.90%> (+0.08%) :arrow_up:
alanhamlett commented 8 months ago

Closing in favor of #1023.