Skip to content

Commit

Permalink
chore: script to count lines
Browse files Browse the repository at this point in the history
  • Loading branch information
kupermind committed Jan 8, 2025
1 parent 0ba444e commit 79616da
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions scripts/count_lines.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

# Input file
files=$(find contracts -name "*.sol" ! -path "contracts/interfaces/*" ! -path "contracts/test/*")
#echo $files
echo "Counting number of lines"
echo ""

let all=0
for file in $files
do
# Count lines excluding comments, empty lines, interfaces, and errors
count=$(grep -vE '^\s*(//|/\*|\*/|\*|$)' "$file" | grep -vE '^\s*(interface|error|import|pragma)' | wc -l)
echo "$file: $count"
echo ""

all=$((all + count))
done

echo "All lines: $all"

0 comments on commit 79616da

Please sign in to comment.