added .resi files to lint checker
				
					
				
			This commit is contained in:
		
							parent
							
								
									16258c2538
								
							
						
					
					
						commit
						af3cab01bc
					
				| 
						 | 
					@ -3,8 +3,9 @@
 | 
				
			||||||
# Hat tip to @dfalling
 | 
					# Hat tip to @dfalling
 | 
				
			||||||
# https://forum.rescript-lang.org/t/rescript-9-1-how-can-we-format-to-standard-out/1590/2?u=quinn-dougherty
 | 
					# https://forum.rescript-lang.org/t/rescript-9-1-how-can-we-format-to-standard-out/1590/2?u=quinn-dougherty
 | 
				
			||||||
 | 
					
 | 
				
			||||||
files=`ls src/rescript/**/**/*.res src/rescript/**/*.res src/rescript/*.res`
 | 
					 | 
				
			||||||
errors=false
 | 
					errors=false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					files=`ls src/rescript/**/**/*.res src/rescript/**/*.res src/rescript/*.res`
 | 
				
			||||||
for file in $files
 | 
					for file in $files
 | 
				
			||||||
do
 | 
					do
 | 
				
			||||||
  current=`cat $file`
 | 
					  current=`cat $file`
 | 
				
			||||||
| 
						 | 
					@ -18,9 +19,23 @@ do
 | 
				
			||||||
  fi
 | 
					  fi
 | 
				
			||||||
done
 | 
					done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					files=`ls src/rescript/**/**/*.resi src/rescript/**/*.resi`  # src/rescript/*/resi
 | 
				
			||||||
 | 
					for file in $files
 | 
				
			||||||
 | 
					do
 | 
				
			||||||
 | 
					  current=`cat $file`
 | 
				
			||||||
 | 
					  linted=`echo "${current}" | rescript format -stdin .resi`
 | 
				
			||||||
 | 
					  diff=`diff <(echo $current) <(echo $linted)`
 | 
				
			||||||
 | 
					  if [ ${#diff} -gt 0 ]
 | 
				
			||||||
 | 
					  then 
 | 
				
			||||||
 | 
					    echo "ERROR: $file doesn't pass lint"
 | 
				
			||||||
 | 
					    errors=true
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if $errors
 | 
					if $errors
 | 
				
			||||||
then
 | 
					then
 | 
				
			||||||
  exit 1
 | 
					  exit 1
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
  echo "All files pass linting!"
 | 
					  echo "All files pass lint"
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user