# Buggy code
def argument_parser():
    parser = argparse.ArgumentParser()
    parser.add_argument(
        "--intermediate-only",
        action="store_true",
        help="generate intermediary files only",
    )
    parser.add_argument(
        "--include",
        nargs="+",
        help="include user specified directory of custom field definitions",
    )
    parser.add_argument("--subset", nargs="+", help="render a subset of the schema")
    parser.add_argument(
        "--out", action="store", help="directory to store the generated files"
    )
    parser.add_argument(
        "--ref", action="store", help="git reference to use when building schemas"
    )
    parser.add_argument(
        "--template-settings",
        action="store",
        help="index template settings to use when generating elasticsearch template",
    )
    parser.add_argument(
        "--mapping-settings",
        action="store",
        help="mapping settings to use when generating elasticsearch template",
    )
    args = parser.parse_args()
    # Clean up empty include of the Makefile
    if args.include and [""] == args.include:
        args.include.clear()
    return args


# Traceback (ValueError)
$ python scripts/generator.py --ref v1.5.0
Loading schemas from git ref v1.5.0
Running generator. ECS version 1.5.0
Traceback (most recent call last):
File "scripts/generator.py", line 94, in <module>
main()
File "scripts/generator.py", line 44, in main
cleaner.clean(fields)
File "<redacted>/ecs/scripts/schema/cleaner.py", line 23, in clean
visitor.visit_fields(fields, fieldset_func=schema_cleanup, field_func=field_cleanup)
File "<redacted>/ecs/scripts/schema/visitor.py", line 21, in visit_fields
visit_fields(details['fields'],
File "<redacted>/ecs/scripts/schema/visitor.py", line 19, in visit_fields
field_func(details)
File "<redacted>/ecs/scripts/schema/cleaner.py", line 125, in field_cleanup
field_assertions_and_warnings(field)
File "<redacted>/ecs/scripts/schema/cleaner.py", line 168, in field_assertions_and_warnings
single_line_short_description(field)
File "<redacted>/ecs/scripts/schema/cleaner.py", line 189, in single_line_short_description
raise ValueError(msg)
ValueError: Short descriptions must be single line, and under 120 characters (current length: 134).
Offending field or field set: number
Short description:
Unique number allocated to the autonomous system. The autonomous system number (ASN) uniquely identifies each network on the Internet.

# Fixed code
def argument_parser():
    parser = argparse.ArgumentParser()
    parser.add_argument(
        "--intermediate-only",
        action="store_true",
        help="generate intermediary files only",
    )
    parser.add_argument(
        "--include",
        nargs="+",
        help="include user specified directory of custom field definitions",
    )
    parser.add_argument("--subset", nargs="+", help="render a subset of the schema")
    parser.add_argument(
        "--out", action="store", help="directory to store the generated files"
    )
    parser.add_argument(
        "--ref", action="store", help="git reference to use when building schemas"
    )
    parser.add_argument(
        "--template-settings",
        action="store",
        help="index template settings to use when generating elasticsearch template",
    )
    parser.add_argument(
        "--mapping-settings",
        action="store",
        help="mapping settings to use when generating elasticsearch template",
    )
    parser.add_argument(
        "--strict",
        action="store_true",
        help="enforce stricter checking at schema cleanup",
    )
    args = parser.parse_args()
    # Clean up empty include of the Makefile
    if args.include and [""] == args.include:
        args.include.clear()
    return args