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

Revert "Make lexers auto-register themselves" #960

Closed gandarez closed 11 months ago

gandarez commented 11 months ago

This PR reverts the auto-initializer lexers to avoid 100% CPU usage in tests and to run integration ones in around 2.5s. The problem was related to the massive use of function init which causes high CPU due to its internal implementation.

This reverts commit 705820674b74ef235638a25ea10eca37a9248b4b.

codecov[bot] commented 11 months ago

Codecov Report

Merging #960 (8ee0359) into develop (defa273) will decrease coverage by 9.30%. The diff coverage is 33.27%.

@@             Coverage Diff             @@
##           develop     #960      +/-   ##
===========================================
- Coverage    71.70%   62.41%   -9.30%     
===========================================
  Files          372      372              
  Lines        16529    15649     -880     
===========================================
- Hits         11852     9767    -2085     
- Misses        3693     5357    +1664     
+ Partials       984      525     -459     
Flag Coverage Δ
unittests 62.41% <33.27%> (-9.30%) :arrow_down:

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

Files Coverage Δ
pkg/lexer/aspxcsharp.go 75.00% <100.00%> (+12.03%) :arrow_up:
pkg/lexer/aspxvb.go 75.00% <100.00%> (+12.03%) :arrow_up:
pkg/lexer/bbcbasic.go 70.00% <100.00%> (+11.66%) :arrow_up:
pkg/lexer/bugs.go 71.42% <100.00%> (+13.09%) :arrow_up:
pkg/lexer/ca65assembler.go 72.72% <100.00%> (+12.72%) :arrow_up:
pkg/lexer/cbmbasicv2.go 73.91% <100.00%> (+12.37%) :arrow_up:
pkg/lexer/cuda.go 63.63% <100.00%> (+9.79%) :arrow_up:
pkg/lexer/easytrieve.go 68.68% <100.00%> (+2.66%) :arrow_up:
pkg/lexer/ec.go 63.63% <100.00%> (+9.79%) :arrow_up:
pkg/lexer/ecl.go 84.37% <100.00%> (+9.37%) :arrow_up:
... and 222 more

... and 57 files with indirect coverage changes