Skip to content

Commit

Permalink
split main() to make pylint happy
Browse files Browse the repository at this point in the history
addressing:
logdetective/logdetective.py:12: R0915[too-many-statements]: main: Too many statements (55/50)
  • Loading branch information
xsuchy authored and jpodivin committed Aug 19, 2024
1 parent 598f97b commit 525b456
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions logdetective/logdetective.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@

LOG = logging.getLogger("logdetective")


def main():
"""Main execution function."""
def setup_args():
""" Setup argument parser and return arguments. """
parser = argparse.ArgumentParser("logdetective")
parser.add_argument("file", type=str,
default="", help="The URL or path to the log file to be analyzed.")
Expand All @@ -33,7 +32,12 @@ def main():
This only makes sense when you are summarizing with Drain")
parser.add_argument("-v", "--verbose", action='count', default=0)
parser.add_argument("-q", "--quiet", action='store_true')
args = parser.parse_args()
return parser.parse_args()


def main():
"""Main execution function."""
args = setup_args()

if args.verbose and args.quiet:
sys.stderr.write("Error: --quiet and --verbose is mutually exclusive.\n")
Expand Down

0 comments on commit 525b456

Please sign in to comment.