From 5fa86d223205e3ff55022cfb50fbb4d0db85782b Mon Sep 17 00:00:00 2001 From: mbrinkhoff Date: Mon, 3 Feb 2025 09:57:06 +0100 Subject: [PATCH] Fix: Ruff updates --- troubadix/argparser.py | 17 ++++++----------- troubadix/plugins/badwords.py | 2 +- .../standalone_plugins/last_modification.py | 7 +++---- troubadix/troubadix.py | 2 +- 4 files changed, 11 insertions(+), 17 deletions(-) diff --git a/troubadix/argparser.py b/troubadix/argparser.py index 1bbd292d..fb06efa6 100644 --- a/troubadix/argparser.py +++ b/troubadix/argparser.py @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -""" Argument parser for troubadix """ +"""Argument parser for troubadix""" import sys from argparse import ArgumentParser, Namespace @@ -81,8 +81,7 @@ def parse_args( "--full", action="store_true", help=( - "Checking the complete VT directory and " - "not only the added/changed scripts" + "Checking the complete VT directory and not only the added/changed scripts" ), ) @@ -96,8 +95,7 @@ def parse_args( "-r", "--root", type=directory_type, - help="Root directory for the nasl files. Will be derived from the " - "content if not set.", + help="Root directory for the nasl files. Will be derived from the content if not set.", ) what_group = parser.add_mutually_exclusive_group(required=False) @@ -152,8 +150,7 @@ def parse_args( "--non-recursive", action="store_true", help=( - "Don't run the script recursive. " - 'Only usable with "-f"/"--full" or "-d"/"--dirs"' + 'Don\'t run the script recursive. Only usable with "-f"/"--full" or "-d"/"--dirs"' ), ) @@ -219,8 +216,7 @@ def parse_args( default=max(1, cpu_count() // 2), type=check_cpu_count, help=( - "Define number of jobs, that should run simultaneously. " - "Default: %(default)s" + "Define number of jobs, that should run simultaneously. Default: %(default)s" ), ) @@ -254,8 +250,7 @@ def parse_args( and parsed_args.non_recursive ): terminal.warning( - "'Argument '--non-recursive' is only usable with " - "'-f'/'--full' or '-d'/'--dirs'" + "'Argument '--non-recursive' is only usable with '-f'/'--full' or '-d'/'--dirs'" ) sys.exit(1) diff --git a/troubadix/plugins/badwords.py b/troubadix/plugins/badwords.py index f2505190..c67b2cdd 100644 --- a/troubadix/plugins/badwords.py +++ b/troubadix/plugins/badwords.py @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -""" checking badwords in NASL scripts with the NASLinter """ +"""checking badwords in NASL scripts with the NASLinter""" from pathlib import Path from typing import Iterable, Iterator diff --git a/troubadix/standalone_plugins/last_modification.py b/troubadix/standalone_plugins/last_modification.py index e03ca0bf..f004a69d 100644 --- a/troubadix/standalone_plugins/last_modification.py +++ b/troubadix/standalone_plugins/last_modification.py @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -""" updating the modification time in VTs that have been touched/edited """ +"""updating the modification time in VTs that have been touched/edited""" import datetime import re @@ -57,8 +57,7 @@ def update(nasl_file: Path, terminal: Terminal): if not match_last_modification_any_value: terminal.warning( - f'Ignoring "{nasl_file}" because it is missing a ' - "last_modification tag." + f'Ignoring "{nasl_file}" because it is missing a last_modification tag.' ) return @@ -81,7 +80,7 @@ def update(nasl_file: Path, terminal: Terminal): ) if not match_script_version: terminal.warning( - f'Ignoring "{nasl_file}" because it is missing a ' "script_version." + f'Ignoring "{nasl_file}" because it is missing a script_version.' ) return diff --git a/troubadix/troubadix.py b/troubadix/troubadix.py index 7348ef24..90c20bb8 100644 --- a/troubadix/troubadix.py +++ b/troubadix/troubadix.py @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -""" Main module for troubadix """ +"""Main module for troubadix""" import sys from collections.abc import Iterable