Changeset View
Changeset View
Standalone View
Standalone View
test/lint/lint-python-format.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# | # | ||||
# Copyright (c) 2019 The Bitcoin developers | # Copyright (c) 2019 The Bitcoin developers | ||||
# Distributed under the MIT software license, see the accompanying | # Distributed under the MIT software license, see the accompanying | ||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | # file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
# | # | ||||
# Lint python format : This program checks that the old python fomatting method | # Lint python format : This program checks that the old python fomatting method | ||||
# is not being used (formatting with "string %s" % content). | # is not being used (formatting with "string %s" % content). | ||||
# The new "{}".format(content) or f"{} content" method should be used instead. | # The new "{}".format(content) or f"{} content" method should be used instead. | ||||
# Usage of the % formatter is expected to be deprecated by python in the future. | # Usage of the % formatter is expected to be deprecated by python in the | ||||
# future. | |||||
import re | import re | ||||
import sys | import sys | ||||
from doctest import testmod | from doctest import testmod | ||||
def is_complete(snippet): | def is_complete(snippet): | ||||
r"""Check if a code snippet is complete. | r"""Check if a code snippet is complete. | ||||
▲ Show 20 Lines • Show All 265 Lines • Show Last 20 Lines |