""" Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: MIT-0 """ import logging import sys import warnings import cfnlint.core LOGGER = logging.getLogger("cfnlint") def main(): if sys.version_info[:2] == (3, 4): warnings.warn( "Python 3.4 has reached end of life. " "cfn-lint has ended support for python 3.4 as of July 1st, 2020.", Warning, stacklevel=3, ) elif sys.version_info[:2] == (3, 5): warnings.warn( "Python 3.5 has reached end of life. " "cfn-lint has ended support for python 3.5 as of August 1st, 2021.", Warning, stacklevel=3, ) elif sys.version_info[:2] == (2, 7): warnings.warn( "Python 2.7 has reached end of life. " "cfn-lint will end support for python 2.7 on June 1st, 2020.", Warning, stacklevel=3, ) try: (args, filenames, formatter) = cfnlint.core.get_args_filenames(sys.argv[1:]) matches = list(cfnlint.core.get_matches(filenames, args)) rules = cfnlint.core.get_used_rules() matches_output = formatter.print_matches(matches, rules, filenames) if matches_output: if args.output_file: with open(args.output_file, "w", encoding="utf-8") as output_file: output_file.write(matches_output) else: print(matches_output) return cfnlint.core.get_exit_code(matches, args.non_zero_exit_code) except cfnlint.core.CfnLintExitException as e: LOGGER.error(str(e)) return e.exit_code if __name__ == "__main__": try: sys.exit(main()) except (ValueError, TypeError): LOGGER.error(ValueError)
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
__pycache__ | Folder | 0755 |
|
|
conditions | Folder | 0755 |
|
|
data | Folder | 0755 |
|
|
decode | Folder | 0755 |
|
|
decorators | Folder | 0755 |
|
|
formatters | Folder | 0755 |
|
|
rules | Folder | 0755 |
|
|
template | Folder | 0755 |
|
|
__init__.py | File | 2.47 KB | 0644 |
|
__main__.py | File | 1.78 KB | 0644 |
|
api.py | File | 1.59 KB | 0644 |
|
config.py | File | 26.56 KB | 0644 |
|
core.py | File | 11.02 KB | 0644 |
|
exceptions.py | File | 592 B | 0644 |
|
graph.py | File | 10.85 KB | 0644 |
|
helpers.py | File | 21.95 KB | 0644 |
|
languageExtensions.py | File | 1.98 KB | 0644 |
|
maintenance.py | File | 18.87 KB | 0644 |
|
runner.py | File | 3.93 KB | 0644 |
|
transform.py | File | 8.48 KB | 0644 |
|
version.py | File | 130 B | 0644 |
|