aboutsummaryrefslogtreecommitdiff
path: root/lib/print_stats.py
diff options
context:
space:
mode:
authorromangraef <roman.graef@gmail.com>2018-06-03 13:46:20 +0200
committerromangraef <roman.graef@gmail.com>2018-06-03 13:46:20 +0200
commit2748ab3d274f67a2a701ba4f7d5d98ab2da6e025 (patch)
treef674b9bfb910841894549b6696dbc4d848d24d8d /lib/print_stats.py
downloadtabsvsspaces-2748ab3d274f67a2a701ba4f7d5d98ab2da6e025.tar.gz
tabsvsspaces-2748ab3d274f67a2a701ba4f7d5d98ab2da6e025.tar.bz2
tabsvsspaces-2748ab3d274f67a2a701ba4f7d5d98ab2da6e025.zip
Initial commit
Diffstat (limited to 'lib/print_stats.py')
-rw-r--r--lib/print_stats.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/print_stats.py b/lib/print_stats.py
new file mode 100644
index 0000000..9616caa
--- /dev/null
+++ b/lib/print_stats.py
@@ -0,0 +1,17 @@
+from lib.stats import Statistics
+
+
+def print_stats(stats: Statistics, by_extension: bool):
+ print('spaces:', stats.all_spaces)
+ print('tabs:', stats.all_tabs)
+ print('mixed:', stats.all_mixed)
+ if by_extension:
+ for ext in set(stats.space_dict.keys()) | stats.tab_dict.keys() | stats.mixed_line_dict.keys():
+ print(ext + ':')
+ print(' ', 'spaces:', stats.space_dict[ext])
+ print(' ', 'tabs:', stats.tab_dict[ext])
+ print(' ', 'mixed:', stats.mixed_line_dict[ext])
+ if stats.all_mixed > 0:
+ print('files_with_mixed_lines:')
+ for file in stats.mixed_files:
+ print(' -', file)