scripts: Prefer 1;30-37m ansi codes over 90-97m

Reading Wikipedia:

> Later terminals added the ability to directly specify the "bright"
> colors with 90–97 and 100–107.

So if we want to stick to one pattern, we should probably go with
brightness as a separate modifier.

This shouldn't noticeably change any script, unless your terminal
interprets 90-97m colors differently from 1;30-37m, in which case things
should be more consistent now.
This commit is contained in:
Christopher Haster
2025-04-10 15:30:27 -05:00
parent cd039f6227
commit b715e9a749
8 changed files with 32 additions and 33 deletions
+9 -9
View File
@@ -156,7 +156,7 @@ class BenchCase:
for k in config.keys():
print('%swarning:%s in %s, found unused key %r' % (
'\x1b[01;33m' if args['color'] else '',
'\x1b[1;33m' if args['color'] else '',
'\x1b[m' if args['color'] else '',
self.name,
k),
@@ -264,7 +264,7 @@ class BenchSuite:
for k in config.keys():
print('%swarning:%s in %s, found unused key %r' % (
'\x1b[01;33m' if args['color'] else '',
'\x1b[1;33m' if args['color'] else '',
'\x1b[m' if args['color'] else '',
self.name,
k),
@@ -305,7 +305,7 @@ def compile(bench_paths, **args):
if len(pending_) == len(pending):
print('%serror:%s cycle detected in suite ordering: {%s}' % (
'\x1b[01;31m' if args['color'] else '',
'\x1b[1;31m' if args['color'] else '',
'\x1b[m' if args['color'] else '',
', '.join(suite.name for suite in pending.values())),
file=sys.stderr)
@@ -319,7 +319,7 @@ def compile(bench_paths, **args):
for suite in suites:
if suite.name in seen:
print('%swarning:%s conflicting suite %r, %s and %s' % (
'\x1b[01;33m' if args['color'] else '',
'\x1b[1;33m' if args['color'] else '',
'\x1b[m' if args['color'] else '',
suite.name,
suite.path,
@@ -333,7 +333,7 @@ def compile(bench_paths, **args):
isinstance(seen[case.name], BenchSuite)
and seen[case.name].cases == [case]):
print('%swarning:%s conflicting case %r, %s and %s' % (
'\x1b[01;33m' if args['color'] else '',
'\x1b[1;33m' if args['color'] else '',
'\x1b[m' if args['color'] else '',
case.name,
case.path,
@@ -345,7 +345,7 @@ def compile(bench_paths, **args):
if not args.get('source'):
if len(suites) > 1:
print('%serror:%s compiling more than one bench suite? (%r)' % (
'\x1b[01;31m' if args['color'] else '',
'\x1b[1;31m' if args['color'] else '',
'\x1b[m' if args['color'] else '',
bench_paths),
file=sys.stderr)
@@ -893,7 +893,7 @@ def find_ids(runner, bench_ids=[], **args):
# no suite/case found? error
if not bench_ids__:
print('%serror:%s no benches match id %r?' % (
'\x1b[01;31m' if args['color'] else '',
'\x1b[1;31m' if args['color'] else '',
'\x1b[m' if args['color'] else '',
id),
file=sys.stderr)
@@ -1409,7 +1409,7 @@ def run(runner, bench_ids=[], **args):
print('%s%s:%d:%sfailure:%s %s%s failed' % (
'\x1b[01m' if args['color'] else '',
path, lineno,
'\x1b[01;31m' if args['color'] else '',
'\x1b[1;31m' if args['color'] else '',
'\x1b[m' if args['color'] else '',
failure.id,
' (%s)' % ', '.join('%s=%s' % (k,v)
@@ -1428,7 +1428,7 @@ def run(runner, bench_ids=[], **args):
print('%s%s:%d:%sassert:%s %s' % (
'\x1b[01m' if args['color'] else '',
path, lineno,
'\x1b[01;31m' if args['color'] else '',
'\x1b[1;31m' if args['color'] else '',
'\x1b[m' if args['color'] else '',
message))
with open(path) as f: