Skip to content

Commit

Permalink
Move argument assignment to main method
Browse files Browse the repository at this point in the history
  • Loading branch information
dormant-user committed Oct 25, 2023
1 parent e069505 commit a349f30
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions src/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,6 @@
import lookup
from logger import LOGGER

OWNER = sys.argv[1]
REPO = sys.argv[2]
FAIL = sys.argv[3]
DEBUG = sys.argv[4]
EXCLUDE_HOSTNAMES = sys.argv[5]

connection.exclusions.extend(list(filter(None, map(str.strip, EXCLUDE_HOSTNAMES.split(',')))))

if DEBUG == "true":
LOGGER.setLevel(level=logging.DEBUG)
else:
LOGGER.setLevel(level=logging.INFO)

LOGGER.debug(connection.exclusions)


def verify_hyperlinks_in_md(filename: str) -> None:
"""Get all hyperlinks in a markdown file and validate them in a pool of threads.
Expand Down Expand Up @@ -94,8 +79,19 @@ def check_all_md_files() -> None:
sys.exit(1)
elif _set_exit_code:
LOGGER.exception("Setting exit code to 0, although there were errors")
sys.exit(0)
sys.exit(0)


if __name__ == '__main__':
OWNER = sys.argv[1]
REPO = sys.argv[2]
FAIL = sys.argv[3]
DEBUG = sys.argv[4]
EXCLUDE_HOSTNAMES = sys.argv[5]
connection.exclusions.extend(list(filter(None, map(str.strip, EXCLUDE_HOSTNAMES.split(',')))))
if DEBUG == "true":
LOGGER.setLevel(level=logging.DEBUG)
else:
LOGGER.setLevel(level=logging.INFO)
LOGGER.debug(connection.exclusions)
check_all_md_files()

0 comments on commit a349f30

Please sign in to comment.