File tree Expand file tree Collapse file tree 2 files changed +10
-31
lines changed Expand file tree Collapse file tree 2 files changed +10
-31
lines changed Original file line number Diff line number Diff line change 4242      # Override command to filter out non-cabal files 
4343      command =  pkgs . writeShellApplication { 
4444        name =  "cabal-fmt-wrapper" ; 
45-         text =  '' 
46-           cabal_files=() 
47-           for file in "$@"; do 
48-             # Only process .cabal files 
49-             case "$file" in 
50-               *.cabal) 
51-                 cabal_files+=("$file") 
52-                 ;; 
53-               *) 
54-                 # Skip non-cabal files (e.g., .hs files) 
55-                 ;; 
56-             esac 
57-           done 
58- 
59-           if [ '' ${#cabal_files[@]} -gt 0 ]; then 
60-             ${ lib . getExe cfg . package }  --inplace "'' ${cabal_files[@]}" 
61-           fi 
62-         '' ; 
45+         # The cabal file needs to be formatted by a formatter along with other Haskell source code. 
46+         # For example, module completion by `cabal-fmt: discover`. 
47+         # It is difficult to determine this strictly. 
48+         # Since formatting with cabal-fmt doesn't take much time, we execute it speculatively. 
49+         text =  ''${ pkgs . git } /bin/git ls-files -z "*.cabal"|${ pkgs . parallel } /bin/parallel --null "${ lib . getExe cfg . package }  --inplace {}"'' ; 
6350      } ; 
6451      # Clear args since we're handling them in the wrapper 
6552      options =  lib . mkForce [  ] ; 
Original file line number Diff line number Diff line change 4646      # https://github.com/tfausak/cabal-gild/issues/35 
4747      command =  pkgs . writeShellApplication { 
4848        name =  "cabal-gild-wrapper" ; 
49-         text =  '' 
50-           for file in "$@"; do 
51-             # Only process .cabal files and cabal.project files 
52-             case "$file" in 
53-               *.cabal|cabal.project|cabal.project.local) 
54-                 ${ lib . getExe cfg . package }  --io="$file" 
55-                 ;; 
56-               *) 
57-                 # Skip non-cabal files (e.g., .hs files) 
58-                 ;; 
59-             esac 
60-           done 
61-         '' ; 
49+         # The cabal file needs to be formatted by a formatter along with other Haskell source code. 
50+         # For example, module completion by `cabal-gild: discover`. 
51+         # It is difficult to determine this strictly. 
52+         # Since formatting with cabal-gild doesn't take much time, we execute it speculatively. 
53+         text =  ''${ pkgs . git } /bin/git ls-files -z "*.cabal"|${ pkgs . parallel } /bin/parallel --null "${ lib . getExe cfg . package }  --io {}"'' ; 
6254      } ; 
6355    } ; 
6456  } ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments