在VSCode中 flake8忽略_未使用的错误 就是这样
try:
pass
except Exception as _:
pass
然后flake8显示未使用的错误'_'
答案 0 :(得分:-2)
def run(self):
"""Run the plugin."""
for message in self.messages:
col = getattr(message, "col", 0)
yield (
message.lineno,
col,
"{} {}".format(
FLAKE8_PYFLAKES_CODES.get(type(message).__name__, "F999"),
message.message % message.message_args,
),
message.__class__,
)
def run(self):
"""Run the plugin."""
for message in self.messages:
col = getattr(message, "col", 0)
if ('F841' in FLAKE8_PYFLAKES_CODES.get(
type(message).__name__, "F999")
and "'_'" in message.message_args):
yield (
message.lineno,
col,
"{} {}".format(
FLAKE8_PYFLAKES_CODES.get(
type(message).__name__, "F999"),
message.message % message.message_args,
),
message.__class__,
)