Skip to content

Commit

Permalink
Fix: Ruff updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrinkhoff committed Feb 3, 2025
1 parent de22fe1 commit 5fa86d2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 17 deletions.
17 changes: 6 additions & 11 deletions troubadix/argparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

""" Argument parser for troubadix """
"""Argument parser for troubadix"""

import sys
from argparse import ArgumentParser, Namespace
Expand Down Expand Up @@ -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"
),
)

Expand All @@ -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)
Expand Down Expand Up @@ -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"'
),
)

Expand Down Expand Up @@ -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"
),
)

Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion troubadix/plugins/badwords.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

""" 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
Expand Down
7 changes: 3 additions & 4 deletions troubadix/standalone_plugins/last_modification.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

""" 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
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion troubadix/troubadix.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

""" Main module for troubadix """
"""Main module for troubadix"""

import sys
from collections.abc import Iterable
Expand Down

0 comments on commit 5fa86d2

Please sign in to comment.