From 2a026a484222d230117d5451089eb34870d0e3b9 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Mon, 1 Jun 2026 12:42:02 -0700 Subject: [PATCH] Stop using Ruff "preview" rules, as CI has an older version of Ruff. --- borgmatic/commands/arguments.py | 6 +++--- borgmatic/commands/borgmatic.py | 2 +- borgmatic/logger.py | 2 +- pyproject.toml | 5 +---- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/borgmatic/commands/arguments.py b/borgmatic/commands/arguments.py index 8c9419a1..25c49f7a 100644 --- a/borgmatic/commands/arguments.py +++ b/borgmatic/commands/arguments.py @@ -325,7 +325,7 @@ def make_argument_description(schema, flag_name): ' To specify a different list element, replace the "[0]" with another array index ("[1]", "[2]", etc.).', ) - if example and schema_type in ('array', 'object'): # noqa: PLR6201 + if example and schema_type in ('array', 'object'): example_buffer = io.StringIO() yaml = ruamel.yaml.YAML(typ='safe') yaml.default_flow_style = True @@ -2128,7 +2128,7 @@ def parse_arguments(schema, *unparsed_arguments): ) if ( - ('list' in arguments and 'repo-info' in arguments and arguments['list'].json) # noqa: PLR0916 + ('list' in arguments and 'repo-info' in arguments and arguments['list'].json) or ('list' in arguments and 'info' in arguments and arguments['list'].json) or ('repo-info' in arguments and 'info' in arguments and arguments['repo-info'].json) ): @@ -2146,7 +2146,7 @@ def parse_arguments(schema, *unparsed_arguments): 'With the repo-list action, only one of --prefix or --match-archives flags can be used.', ) - if 'info' in arguments and ( # noqa: PLR0916 + if 'info' in arguments and ( (arguments['info'].archive and arguments['info'].prefix) or (arguments['info'].archive and arguments['info'].match_archives) or (arguments['info'].prefix and arguments['info'].match_archives) diff --git a/borgmatic/commands/borgmatic.py b/borgmatic/commands/borgmatic.py index f2a3b613..2298b239 100644 --- a/borgmatic/commands/borgmatic.py +++ b/borgmatic/commands/borgmatic.py @@ -212,7 +212,7 @@ def run_configuration(config_filename, config, config_paths, arguments): # noqa f"Skipping {'/'.join(skip_actions)} action{'s' if len(skip_actions) > 1 else ''} due to configured skip_actions", ) - try: # noqa: PLR1702 + try: with ( Monitoring_hooks(config_filename, config, arguments, global_arguments), borgmatic.hooks.command.Before_after_hooks( diff --git a/borgmatic/logger.py b/borgmatic/logger.py index 09414615..fad810df 100644 --- a/borgmatic/logger.py +++ b/borgmatic/logger.py @@ -169,7 +169,7 @@ class Json_formatter(logging.Formatter): def __init__(self, fmt='{message}', *args, style='{', **kwargs): super().__init__(*args, fmt=fmt, style=style, **kwargs) - def format(self, record): # noqa: PLR6301 + def format(self, record): return log_record_to_json(record) diff --git a/pyproject.toml b/pyproject.toml index f0748c4d..77ba0475 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,7 +57,7 @@ exclude = ["*.*/*"] quote-style = "preserve" [tool.ruff.lint] -preview = true +preview = false extend-select = [ "A", # flake8-builtins: builtin shadowing "B", # flake8-bugbear: bugs and design problems @@ -134,8 +134,5 @@ known-first-party = ["borgmatic"] "T201", # print statement ] -[tool.ruff.lint.pylint] -max-statements-in-try = 35 - [tool.codespell] skip = ".git,.tox,build"