pronto-rustcov 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/lib/pronto/rustcov.rb +8 -3
 - metadata +1 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: bb33cf0ba6f6437b808ddc35ee00823c3cfbf03d463dc943b4255597dca768b2
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 50f0acb9d7d0c3c240ca13e5191d7f871512d4280ad3ba92d25a4f6fd94fec8e
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 9eae0d6aa9a54c4dd6986fe8423b2a6e805ddc32af24b2321cbb6f1434af8596544eda819248313a45904585cf6bc17759f6f2e81de0f281e457c9bd3eeca0bf
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 4d9156c24fe8183937b769a36ed7782384d4e8875794b1014106cc32d6546feddd2de5d9787190d306428810159ebb0b4bc5eefda7d8fbb108f1d566c9de4d3d
         
     | 
    
        data/lib/pronto/rustcov.rb
    CHANGED
    
    | 
         @@ -6,8 +6,12 @@ module Pronto 
     | 
|
| 
       6 
6 
     | 
    
         
             
                  one_message_per_file('target/lcov.info')
         
     | 
| 
       7 
7 
     | 
    
         
             
                end
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
       9 
     | 
    
         
            -
                def  
     | 
| 
       10 
     | 
    
         
            -
                  ENV[' 
     | 
| 
      
 9 
     | 
    
         
            +
                def pronto_files_limit
         
     | 
| 
      
 10 
     | 
    
         
            +
                  ENV['PRONTO_RUSTCOV_FILES_LIMIT']&.to_i || 5
         
     | 
| 
      
 11 
     | 
    
         
            +
                end
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
                def pronto_messages_per_file_limit
         
     | 
| 
      
 14 
     | 
    
         
            +
                  ENV['PRONTO_RUSTCOV_MESSAGES_PER_FILE_LIMIT']&.to_i || 5
         
     | 
| 
       11 
15 
     | 
    
         
             
                end
         
     | 
| 
       12 
16 
     | 
    
         | 
| 
       13 
17 
     | 
    
         
             
                def one_message_per_file(lcov_path)
         
     | 
| 
         @@ -17,7 +21,7 @@ module Pronto 
     | 
|
| 
       17 
21 
     | 
    
         | 
| 
       18 
22 
     | 
    
         
             
                  grouped = Hash.new { |h, k| h[k] = [] }
         
     | 
| 
       19 
23 
     | 
    
         | 
| 
       20 
     | 
    
         
            -
                  @patches.sort_by { |patch| -patch.added_lines.count }.take( 
     | 
| 
      
 24 
     | 
    
         
            +
                  @patches.sort_by { |patch| -patch.added_lines.count }.take(pronto_files_limit).each do |patch|
         
     | 
| 
       21 
25 
     | 
    
         
             
                    next unless patch.added_lines.any?
         
     | 
| 
       22 
26 
     | 
    
         
             
                    file_path = patch.new_file_full_path.to_s
         
     | 
| 
       23 
27 
     | 
    
         
             
                    uncovered = lcov[file_path]
         
     | 
| 
         @@ -33,6 +37,7 @@ module Pronto 
     | 
|
| 
       33 
37 
     | 
    
         
             
                  grouped.map do |patch, lines|
         
     | 
| 
       34 
38 
     | 
    
         
             
                    linenos = lines.map(&:new_lineno).sort
         
     | 
| 
       35 
39 
     | 
    
         
             
                    ranges = linenos.chunk_while { |i, j| j == i + 1 }
         
     | 
| 
      
 40 
     | 
    
         
            +
                                    .take(pronto_messages_per_file_limit)
         
     | 
| 
       36 
41 
     | 
    
         
             
                                    .map { |group| group.size > 1 ? "#{group.first}–#{group.last}" : group.first.to_s }
         
     | 
| 
       37 
42 
     | 
    
         | 
| 
       38 
43 
     | 
    
         
             
                    message_text = "⚠️ Test coverage is missing for lines: #{ranges.join(', ')}"
         
     |