Skip to content

Commit

Permalink
Change: move config file default location and change flag
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasHargarter committed Jul 8, 2024
1 parent ec62dae commit 8d4f40c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
7 changes: 5 additions & 2 deletions troubadix_config.toml → troubadix.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Use Taplo / VS Code Even Better TOML for formatting

title = "Troubadix Plugin Config File"
# File Structure:
# [plugin_name]
# config_a = value_a
# config_b = value_b

[check_http_links_in_tags]
description = "Strings that should be ignored because they contain a valid URL type in a tag"
# Strings that should be ignored because they contain a valid URL type in a tag
exclusions = [
"The payloads try to open a connection to www.google.com",
"The script attempts to connect to www.google.com",
Expand Down
8 changes: 4 additions & 4 deletions troubadix/argparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,13 @@ def parse_args(
)

parser.add_argument(
"--plugins-config-file",
"-c",
"--config",
type=file_type,
default="troubadix_config.toml",
default="troubadix.toml",
help=(
"Specify the path to the file that contains additional "
"configuration for the plugins, such as file and "
"other types of exceptions."
"configuration for the plugins"
),
)

Expand Down
6 changes: 2 additions & 4 deletions troubadix/troubadix.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,10 @@ def main(args=None):

# Get the plugins configurations from the external toml file
try:
with open(parsed_args.plugins_config_file, "rb") as file:
with open(parsed_args.config, "rb") as file:
plugins_config = tomllib.load(file)
except FileNotFoundError:
term.warning(
f"Config file '{parsed_args.plugins_config_file}' does not exist"
)
term.warning(f"Config file '{parsed_args.config}' does not exist")
sys.exit(1)

reporter = Reporter(
Expand Down

0 comments on commit 8d4f40c

Please sign in to comment.