From 61253f7e03c21cbca76c9277c85ee9d64efb2b08 Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Wed, 3 Jul 2024 00:26:57 +0200 Subject: [PATCH] update black rules --- pyftpdlib/_asyncore.py | 12 ++++----- pyftpdlib/handlers.py | 61 +++++++++++++++++++----------------------- pyproject.toml | 2 +- 3 files changed, 34 insertions(+), 41 deletions(-) diff --git a/pyftpdlib/_asyncore.py b/pyftpdlib/_asyncore.py index 4f213420..6e02d18f 100644 --- a/pyftpdlib/_asyncore.py +++ b/pyftpdlib/_asyncore.py @@ -485,13 +485,11 @@ def compact_traceback(): if not tb: # Must have a traceback raise AssertionError("traceback does not exist") while tb: - tbinfo.append( - ( - tb.tb_frame.f_code.co_filename, - tb.tb_frame.f_code.co_name, - str(tb.tb_lineno), - ) - ) + tbinfo.append(( + tb.tb_frame.f_code.co_filename, + tb.tb_frame.f_code.co_name, + str(tb.tb_lineno), + )) tb = tb.tb_next # just to be safe diff --git a/pyftpdlib/handlers.py b/pyftpdlib/handlers.py index 8a51fe34..7f94a745 100644 --- a/pyftpdlib/handlers.py +++ b/pyftpdlib/handlers.py @@ -3094,13 +3094,11 @@ def ftp_STAT(self, path): def ftp_FEAT(self, line): """List all new features supported as defined in RFC-2398.""" features = {'UTF8', 'TVFS'} - features.update( - [ - feat - for feat in ('EPRT', 'EPSV', 'MDTM', 'MFMT', 'SIZE') - if feat in self.proto_cmds - ] - ) + features.update([ + feat + for feat in ('EPRT', 'EPSV', 'MDTM', 'MFMT', 'SIZE') + if feat in self.proto_cmds + ]) features.update(self._extra_feats) if 'MLST' in self.proto_cmds or 'MLSD' in self.proto_cmds: facts = '' @@ -3706,34 +3704,31 @@ class TLS_FTPHandler(SSLConnection, FTPHandler): # overridden attributes dtp_handler = TLS_DTPHandler proto_cmds = FTPHandler.proto_cmds.copy() - proto_cmds.update( - { - 'AUTH': dict( - perm=None, - auth=False, - arg=True, - help=( - 'Syntax: AUTH TLS|SSL (set up secure control ' - 'channel).' - ), + proto_cmds.update({ + 'AUTH': dict( + perm=None, + auth=False, + arg=True, + help=( + 'Syntax: AUTH TLS|SSL (set up secure control ' + 'channel).' ), - 'PBSZ': dict( - perm=None, - auth=False, - arg=True, - help='Syntax: PBSZ 0 (negotiate TLS buffer).', + ), + 'PBSZ': dict( + perm=None, + auth=False, + arg=True, + help='Syntax: PBSZ 0 (negotiate TLS buffer).', + ), + 'PROT': dict( + perm=None, + auth=False, + arg=True, + help=( + 'Syntax: PROT [C|P] (set up un/secure data channel).' ), - 'PROT': dict( - perm=None, - auth=False, - arg=True, - help=( - 'Syntax: PROT [C|P] (set up un/secure data' - ' channel).' - ), - ), - } - ) + ), + }) def __init__(self, conn, server, ioloop=None): super().__init__(conn, server, ioloop) diff --git a/pyproject.toml b/pyproject.toml index 49248924..3ea168fe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ line-length = 79 skip-string-normalization = true # https://black.readthedocs.io/en/stable/the_black_code_style/future_style.html preview = true -enable-unstable-feature = ["multiline_string_handling", "string_processing", "wrap_long_dict_values_in_parens"] +enable-unstable-feature = ["hug_parens_with_braces_and_square_brackets", "multiline_string_handling", "string_processing", "wrap_long_dict_values_in_parens"] [tool.ruff] # https://beta.ruff.rs/docs/settings/