tools: Enable color in shellcheck.
This commit is contained in:
parent
4a1e109f07
commit
975737d71d
4 changed files with 8 additions and 3 deletions
|
|
@ -11,7 +11,7 @@ import sys
|
|||
|
||||
|
||||
ESC = "\x1b"
|
||||
normal = "[m"
|
||||
normal = "[m" # or "[0m"
|
||||
bold = "[1m"
|
||||
italic = "[3m"
|
||||
standout = "[7m"
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ class TermStr(collections.UserString):
|
|||
end_index = part.index("m")
|
||||
except ValueError:
|
||||
end_index = 0
|
||||
if part[:2] == "[m": # Normal
|
||||
if part[:2] == terminal.normal or part[:3] == "[0m": # Normal
|
||||
is_bold, is_italic, is_underlined = False, False, False
|
||||
fg_color, bg_color = None, None
|
||||
elif part[:3] == terminal.bold:
|
||||
|
|
|
|||
|
|
@ -220,7 +220,8 @@ tools_for_extensions = [
|
|||
|
||||
[shellcheck]
|
||||
dependencies = ["shellcheck"]
|
||||
command = "shellcheck"
|
||||
command = "shellcheck --color=always"
|
||||
has_color = true
|
||||
|
||||
[cppcheck]
|
||||
dependencies = ["cppcheck"]
|
||||
|
|
|
|||
|
|
@ -144,6 +144,10 @@ class TermStrTests(unittest.TestCase):
|
|||
eris.terminal.ESC + "[mbar"),
|
||||
termstr.TermStr("foo").bg_color(5) +
|
||||
termstr.TermStr("bar"))
|
||||
self.assertEqual(TermStr.from_term(eris.terminal.ESC + "[45mfoo" +
|
||||
eris.terminal.ESC + "[0mbar"),
|
||||
termstr.TermStr("foo").bg_color(5) +
|
||||
termstr.TermStr("bar"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue