summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorsharkdp <davidpeter@web.de>2020-04-12 17:41:12 +0200
committerDavid Peter <sharkdp@users.noreply.github.com>2020-04-12 19:19:33 +0200
commitfc6f4f31dd7cc9741a313cc010f2ec1407eb45af (patch)
tree4bc64ab9658274b768f28d81c36cfe0f1d78b9c2 /tests
parentf2cef702a02265fef883efba58ef0de5080916f7 (diff)
Add documentation
Diffstat (limited to 'tests')
-rw-r--r--tests/scripts/find-slow-to-highlight-files.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/scripts/find-slow-to-highlight-files.py b/tests/scripts/find-slow-to-highlight-files.py
index be45efa6..ed9e2d9e 100644
--- a/tests/scripts/find-slow-to-highlight-files.py
+++ b/tests/scripts/find-slow-to-highlight-files.py
@@ -1,9 +1,23 @@
+#!/usr/bin/env python
+#
+# This script goes through all languages that are supported by 'bat'. For each
+# language, it loops over the correspoinding file extensions and searches a
+# given folder for matching files. It calls 'bat' for each of these files and
+# measures the highlighting speed (number of characters per second). The script
+# reports files which lead to slow highlighting speeds or errors during the
+# execution of 'bat'.
+#
+# Requirements (external programs):
+# - bat (in the $PATH)
+# - fd (https://github.com/sharkdp/fd)
+# - wc
+
import time
import os
import subprocess as sp
-# Threshold speed in chars per second
+# Threshold speed, characters per second
THRESHOLD_SPEED = 20000
# Maximum time we allow `bat` to run