SERVER-73151 Change pylinters.py to show usage screen when no args are given

This commit is contained in:
stevegrossmongodb 2023-07-12 14:41:02 +00:00 committed by Evergreen Agent
parent 691ec72644
commit b64888d1b1
1 changed files with 6 additions and 1 deletions

View File

@ -206,7 +206,8 @@ def main():
# type: () -> None
"""Execute Main entry point."""
parser = argparse.ArgumentParser(description='PyLinter frontend.')
parser = argparse.ArgumentParser(
description='PyLinter frontend; see more details at https://wiki.corp.mongodb.com/x/1vP5BQ')
linters = get_py_linter(None)
@ -253,6 +254,10 @@ def main():
parser_fix.add_argument("file_names", nargs="*", help="Globs of files to check")
parser_fix.set_defaults(func=fix_scons_func, linters="scons")
# No args given? Fall back to usage screen:
if len(sys.argv) == 1:
parser.print_help()
return
args = parser.parse_args()
# Create a dictionary of linter locations if the user needs to override the location of a