git diff lines of code 1

git diff lines of code

git diff --stat

Here is what the above code is Doing:
1. git diff –stat
– This command will show you the files that have been changed.
2. git diff –stat | grep -E ‘\.(py|js|html|css)$’
– This command will show you the files that have been changed and are of the type .py, .js, .html, or .css.
3. git diff –stat | grep -E ‘\.(py|js|html|css)$’ | awk ‘{print $1}’
– This command will show you the files that have been changed and are of the type .py, .js, .html, or .css, and will only show the file names.
4. git diff –stat | grep -E ‘\.(py|js|html|css)$’ | awk ‘{print $1}’ | xargs -I {} sh -c ‘pycodestyle {} | wc -l’
– This command will show you the files that have been changed and are of the type .py, .js, .html, or .css, and will only show the file names. It will then run pycodestyle on each file and count the number of errors.
5. git diff –stat | grep -E ‘\.(py|js|html|css)$’ | awk ‘{print $1}’ | xargs -I {} sh -c ‘pycodestyle {} | wc -l’ | awk ‘{s+=$1} END {print s}’
– This command will show you the files that have been changed and are of the type .py, .js, .html, or .css, and will only show the file names. It will then run pycodestyle on each file and count the number of errors. It will then add up all of the errors and print the total.

Similar Posts