We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Error running cfn-lint with pipe (|)
cfn-lint version: *v0.23.0*

Hello we have a problem running cfn-lint with find command. Only this version is affected as far as we know.
We are keeping couple of template is a folder and linting them like that:
```
find ./templates -type f | xargs cfn-lint -f parseable -c I -t
```

It worked flawlessly before but with the new update we are getting this error:

> 2019-08-02 15:37:01,818 - cfnlint.decode - ERROR - Template file not found: None
None:1:1:1:2:E0000:Template file not found: None

Splitting the files in separated lines with `xargs -L 1` doesn't help.

If you run the cfn-lint command on it's own it works as expected.

This example **doesn't** work:
```
find ./templates -type f | xargs -t cfn-lint -f parseable -c I -t
cfn-lint -f parseable -c I -t ./templates/t1.yml ./templates/t2.yml ./templates/t3.yml 
2019-08-02 15:50:20,891 - cfnlint.decode - ERROR - Template file not found: None
None:1:1:1:2:E0000:Template file not found: None
```
This example works:
```
cfn-lint -f parseable -c I -t ./templates/t1.yml ./templates/t2.yml ./templates/t3.yml
 ```

Regards TT

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/cfnlint/core.py`
Content:
```
1 """
2   Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 
4   Permission is hereby granted, free of charge, to any person obtaining a copy of this
5   software and associated documentation files (the "Software"), to deal in the Software
6   without restriction, including without limitation the rights to use, copy, modify,
7   merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
8   permit persons to whom the Software is furnished to do so.
9 
10   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
11   INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
12   PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
13   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
14   OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
15   SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16 """
17 import logging
18 import os
19 import sys
20 from jsonschema.exceptions import ValidationError
21 from cfnlint import RulesCollection
22 import cfnlint.config
23 import cfnlint.formatters
24 import cfnlint.decode
25 import cfnlint.maintenance
26 from cfnlint.helpers import REGIONS
27 
28 
29 LOGGER = logging.getLogger('cfnlint')
30 DEFAULT_RULESDIR = os.path.join(os.path.dirname(__file__), 'rules')
31 
32 
33 class CfnLintExitException(Exception):
34     """Generic exception used when the cli should exit"""
35     def __init__(self, msg=None, exit_code=1):
36         if msg is None:
37             msg = 'process failed with exit code %s' % exit_code
38         super(CfnLintExitException, self).__init__(msg)
39         self.exit_code = exit_code
40 
41 
42 class InvalidRegionException(CfnLintExitException):
43     """When an unsupported/invalid region is supplied"""
44 
45 
46 class UnexpectedRuleException(CfnLintExitException):
47     """When processing a rule fails in an unexpected way"""
48 
49 
50 def run_cli(filename, template, rules, regions, override_spec):
51     """Process args and run"""
52 
53     if override_spec:
54         cfnlint.helpers.override_specs(override_spec)
55 
56     return run_checks(filename, template, rules, regions)
57 
58 
59 def get_exit_code(matches):
60     """ Determine exit code """
61     exit_code = 0
62     for match in matches:
63         if match.rule.id[0] == 'I':
64             exit_code = exit_code | 8
65         elif match.rule.id[0] == 'W':
66             exit_code = exit_code | 4
67         elif match.rule.id[0] == 'E':
68             exit_code = exit_code | 2
69 
70     return exit_code
71 
72 
73 def get_formatter(fmt):
74     """ Get Formatter"""
75     formatter = {}
76     if fmt:
77         if fmt == 'quiet':
78             formatter = cfnlint.formatters.QuietFormatter()
79         elif fmt == 'parseable':
80             # pylint: disable=bad-option-value
81             formatter = cfnlint.formatters.ParseableFormatter()
82         elif fmt == 'json':
83             formatter = cfnlint.formatters.JsonFormatter()
84     else:
85         formatter = cfnlint.formatters.Formatter()
86 
87     return formatter
88 
89 
90 def get_rules(rulesdir, ignore_rules, include_rules, configure_rules=None, include_experimental=False):
91     """Get rules"""
92     rules = RulesCollection(ignore_rules, include_rules, configure_rules, include_experimental)
93     rules_dirs = [DEFAULT_RULESDIR] + rulesdir
94     try:
95         for rules_dir in rules_dirs:
96             rules.create_from_directory(rules_dir)
97     except OSError as e:
98         raise UnexpectedRuleException('Tried to append rules but got an error: %s' % str(e), 1)
99     return rules
100 
101 
102 def configure_logging(debug_logging):
103     """ Backwards compatibility for integrators """
104     LOGGER.info('Update your integrations to use "cfnlint.config.configure_logging" instead')
105     cfnlint.config.configure_logging(debug_logging, False)
106 
107 
108 def get_args_filenames(cli_args):
109     """ Get Template Configuration items and set them as default values"""
110     try:
111         config = cfnlint.config.ConfigMixIn(cli_args)
112     except ValidationError as e:
113         LOGGER.error('Error parsing config file: %s', str(e))
114         exit(1)
115 
116     fmt = config.format
117     formatter = get_formatter(fmt)
118 
119     if config.update_specs:
120         cfnlint.maintenance.update_resource_specs()
121         exit(0)
122 
123     if config.update_documentation:
124         # Get ALL rules (ignore the CLI settings))
125         documentation_rules = cfnlint.core.get_rules([], [], ['I', 'E', 'W'], {}, True)
126         cfnlint.maintenance.update_documentation(documentation_rules)
127         exit(0)
128 
129     if config.update_iam_policies:
130         cfnlint.maintenance.update_iam_policies()
131         exit(0)
132 
133     if config.listrules:
134         rules = cfnlint.core.get_rules(
135             config.append_rules,
136             config.ignore_checks,
137             config.include_checks,
138             config.configure_rules
139         )
140         print(rules)
141         exit(0)
142 
143     if not sys.stdin.isatty():
144         return(config, [None], formatter)
145 
146     if not config.templates:
147         # Not specified, print the help
148         config.parser.print_help()
149         exit(1)
150 
151     return(config, config.templates, formatter)
152 
153 
154 def get_template_rules(filename, args):
155     """ Get Template Configuration items and set them as default values"""
156 
157     (template, matches) = cfnlint.decode.decode(filename, args.ignore_bad_template)
158 
159     if matches:
160         return(template, [], matches)
161 
162     args.template_args = template
163 
164     rules = cfnlint.core.get_rules(
165         args.append_rules,
166         args.ignore_checks,
167         args.include_checks,
168         args.configure_rules,
169         args.include_experimental,
170     )
171 
172     return(template, rules, [])
173 
174 
175 def run_checks(filename, template, rules, regions):
176     """Run Checks against the template"""
177     if regions:
178         if not set(regions).issubset(set(REGIONS)):
179             unsupported_regions = list(set(regions).difference(set(REGIONS)))
180             msg = 'Regions %s are unsupported. Supported regions are %s' % (unsupported_regions, REGIONS)
181             raise InvalidRegionException(msg, 32)
182 
183     matches = []
184 
185     runner = cfnlint.Runner(rules, filename, template, regions)
186     matches.extend(runner.transform())
187     # Only do rule analysis if Transform was successful
188     if not matches:
189         try:
190             matches.extend(runner.run())
191         except Exception as err:  # pylint: disable=W0703
192             msg = 'Tried to process rules on file %s but got an error: %s' % (filename, str(err))
193             UnexpectedRuleException(msg, 1)
194     matches.sort(key=lambda x: (x.filename, x.linenumber, x.rule.id))
195 
196     return(matches)
197
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/src/cfnlint/core.py b/src/cfnlint/core.py
--- a/src/cfnlint/core.py
+++ b/src/cfnlint/core.py
@@ -140,7 +140,7 @@
         print(rules)
         exit(0)
 
-    if not sys.stdin.isatty():
+    if not sys.stdin.isatty() and not config.templates:
         return(config, [None], formatter)
 
     if not config.templates:

{"golden_diff": "diff --git a/src/cfnlint/core.py b/src/cfnlint/core.py\n--- a/src/cfnlint/core.py\n+++ b/src/cfnlint/core.py\n@@ -140,7 +140,7 @@\n         print(rules)\n         exit(0)\n \n-    if not sys.stdin.isatty():\n+    if not sys.stdin.isatty() and not config.templates:\n         return(config, [None], formatter)\n \n     if not config.templates:\n", "issue": "Error running cfn-lint with pipe (|)\ncfn-lint version: *v0.23.0*\r\n\r\nHello we have a problem running cfn-lint with find command. Only this version is affected as far as we know.\r\nWe are keeping couple of template is a folder and linting them like that:\r\n```\r\nfind ./templates -type f | xargs cfn-lint -f parseable -c I -t\r\n```\r\n\r\nIt worked flawlessly before but with the new update we are getting this error:\r\n\r\n> 2019-08-02 15:37:01,818 - cfnlint.decode - ERROR - Template file not found: None\r\nNone:1:1:1:2:E0000:Template file not found: None\r\n\r\nSplitting the files in separated lines with `xargs -L 1` doesn't help.\r\n\r\nIf you run the cfn-lint command on it's own it works as expected.\r\n\r\nThis example **doesn't** work:\r\n```\r\nfind ./templates -type f | xargs -t cfn-lint -f parseable -c I -t\r\ncfn-lint -f parseable -c I -t ./templates/t1.yml ./templates/t2.yml ./templates/t3.yml \r\n2019-08-02 15:50:20,891 - cfnlint.decode - ERROR - Template file not found: None\r\nNone:1:1:1:2:E0000:Template file not found: None\r\n```\r\nThis example works:\r\n```\r\ncfn-lint -f parseable -c I -t ./templates/t1.yml ./templates/t2.yml ./templates/t3.yml\r\n ```\r\n\r\nRegards TT\n", "before_files": [{"content": "\"\"\"\n  Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n\n  Permission is hereby granted, free of charge, to any person obtaining a copy of this\n  software and associated documentation files (the \"Software\"), to deal in the Software\n  without restriction, including without limitation the rights to use, copy, modify,\n  merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\n  permit persons to whom the Software is furnished to do so.\n\n  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n  INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n  PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\"\"\"\nimport logging\nimport os\nimport sys\nfrom jsonschema.exceptions import ValidationError\nfrom cfnlint import RulesCollection\nimport cfnlint.config\nimport cfnlint.formatters\nimport cfnlint.decode\nimport cfnlint.maintenance\nfrom cfnlint.helpers import REGIONS\n\n\nLOGGER = logging.getLogger('cfnlint')\nDEFAULT_RULESDIR = os.path.join(os.path.dirname(__file__), 'rules')\n\n\nclass CfnLintExitException(Exception):\n    \"\"\"Generic exception used when the cli should exit\"\"\"\n    def __init__(self, msg=None, exit_code=1):\n        if msg is None:\n            msg = 'process failed with exit code %s' % exit_code\n        super(CfnLintExitException, self).__init__(msg)\n        self.exit_code = exit_code\n\n\nclass InvalidRegionException(CfnLintExitException):\n    \"\"\"When an unsupported/invalid region is supplied\"\"\"\n\n\nclass UnexpectedRuleException(CfnLintExitException):\n    \"\"\"When processing a rule fails in an unexpected way\"\"\"\n\n\ndef run_cli(filename, template, rules, regions, override_spec):\n    \"\"\"Process args and run\"\"\"\n\n    if override_spec:\n        cfnlint.helpers.override_specs(override_spec)\n\n    return run_checks(filename, template, rules, regions)\n\n\ndef get_exit_code(matches):\n    \"\"\" Determine exit code \"\"\"\n    exit_code = 0\n    for match in matches:\n        if match.rule.id[0] == 'I':\n            exit_code = exit_code | 8\n        elif match.rule.id[0] == 'W':\n            exit_code = exit_code | 4\n        elif match.rule.id[0] == 'E':\n            exit_code = exit_code | 2\n\n    return exit_code\n\n\ndef get_formatter(fmt):\n    \"\"\" Get Formatter\"\"\"\n    formatter = {}\n    if fmt:\n        if fmt == 'quiet':\n            formatter = cfnlint.formatters.QuietFormatter()\n        elif fmt == 'parseable':\n            # pylint: disable=bad-option-value\n            formatter = cfnlint.formatters.ParseableFormatter()\n        elif fmt == 'json':\n            formatter = cfnlint.formatters.JsonFormatter()\n    else:\n        formatter = cfnlint.formatters.Formatter()\n\n    return formatter\n\n\ndef get_rules(rulesdir, ignore_rules, include_rules, configure_rules=None, include_experimental=False):\n    \"\"\"Get rules\"\"\"\n    rules = RulesCollection(ignore_rules, include_rules, configure_rules, include_experimental)\n    rules_dirs = [DEFAULT_RULESDIR] + rulesdir\n    try:\n        for rules_dir in rules_dirs:\n            rules.create_from_directory(rules_dir)\n    except OSError as e:\n        raise UnexpectedRuleException('Tried to append rules but got an error: %s' % str(e), 1)\n    return rules\n\n\ndef configure_logging(debug_logging):\n    \"\"\" Backwards compatibility for integrators \"\"\"\n    LOGGER.info('Update your integrations to use \"cfnlint.config.configure_logging\" instead')\n    cfnlint.config.configure_logging(debug_logging, False)\n\n\ndef get_args_filenames(cli_args):\n    \"\"\" Get Template Configuration items and set them as default values\"\"\"\n    try:\n        config = cfnlint.config.ConfigMixIn(cli_args)\n    except ValidationError as e:\n        LOGGER.error('Error parsing config file: %s', str(e))\n        exit(1)\n\n    fmt = config.format\n    formatter = get_formatter(fmt)\n\n    if config.update_specs:\n        cfnlint.maintenance.update_resource_specs()\n        exit(0)\n\n    if config.update_documentation:\n        # Get ALL rules (ignore the CLI settings))\n        documentation_rules = cfnlint.core.get_rules([], [], ['I', 'E', 'W'], {}, True)\n        cfnlint.maintenance.update_documentation(documentation_rules)\n        exit(0)\n\n    if config.update_iam_policies:\n        cfnlint.maintenance.update_iam_policies()\n        exit(0)\n\n    if config.listrules:\n        rules = cfnlint.core.get_rules(\n            config.append_rules,\n            config.ignore_checks,\n            config.include_checks,\n            config.configure_rules\n        )\n        print(rules)\n        exit(0)\n\n    if not sys.stdin.isatty():\n        return(config, [None], formatter)\n\n    if not config.templates:\n        # Not specified, print the help\n        config.parser.print_help()\n        exit(1)\n\n    return(config, config.templates, formatter)\n\n\ndef get_template_rules(filename, args):\n    \"\"\" Get Template Configuration items and set them as default values\"\"\"\n\n    (template, matches) = cfnlint.decode.decode(filename, args.ignore_bad_template)\n\n    if matches:\n        return(template, [], matches)\n\n    args.template_args = template\n\n    rules = cfnlint.core.get_rules(\n        args.append_rules,\n        args.ignore_checks,\n        args.include_checks,\n        args.configure_rules,\n        args.include_experimental,\n    )\n\n    return(template, rules, [])\n\n\ndef run_checks(filename, template, rules, regions):\n    \"\"\"Run Checks against the template\"\"\"\n    if regions:\n        if not set(regions).issubset(set(REGIONS)):\n            unsupported_regions = list(set(regions).difference(set(REGIONS)))\n            msg = 'Regions %s are unsupported. Supported regions are %s' % (unsupported_regions, REGIONS)\n            raise InvalidRegionException(msg, 32)\n\n    matches = []\n\n    runner = cfnlint.Runner(rules, filename, template, regions)\n    matches.extend(runner.transform())\n    # Only do rule analysis if Transform was successful\n    if not matches:\n        try:\n            matches.extend(runner.run())\n        except Exception as err:  # pylint: disable=W0703\n            msg = 'Tried to process rules on file %s but got an error: %s' % (filename, str(err))\n            UnexpectedRuleException(msg, 1)\n    matches.sort(key=lambda x: (x.filename, x.linenumber, x.rule.id))\n\n    return(matches)\n", "path": "src/cfnlint/core.py"}], "after_files": [{"content": "\"\"\"\n  Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n\n  Permission is hereby granted, free of charge, to any person obtaining a copy of this\n  software and associated documentation files (the \"Software\"), to deal in the Software\n  without restriction, including without limitation the rights to use, copy, modify,\n  merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\n  permit persons to whom the Software is furnished to do so.\n\n  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n  INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n  PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\"\"\"\nimport logging\nimport os\nimport sys\nfrom jsonschema.exceptions import ValidationError\nfrom cfnlint import RulesCollection\nimport cfnlint.config\nimport cfnlint.formatters\nimport cfnlint.decode\nimport cfnlint.maintenance\nfrom cfnlint.helpers import REGIONS\n\n\nLOGGER = logging.getLogger('cfnlint')\nDEFAULT_RULESDIR = os.path.join(os.path.dirname(__file__), 'rules')\n\n\nclass CfnLintExitException(Exception):\n    \"\"\"Generic exception used when the cli should exit\"\"\"\n    def __init__(self, msg=None, exit_code=1):\n        if msg is None:\n            msg = 'process failed with exit code %s' % exit_code\n        super(CfnLintExitException, self).__init__(msg)\n        self.exit_code = exit_code\n\n\nclass InvalidRegionException(CfnLintExitException):\n    \"\"\"When an unsupported/invalid region is supplied\"\"\"\n\n\nclass UnexpectedRuleException(CfnLintExitException):\n    \"\"\"When processing a rule fails in an unexpected way\"\"\"\n\n\ndef run_cli(filename, template, rules, regions, override_spec):\n    \"\"\"Process args and run\"\"\"\n\n    if override_spec:\n        cfnlint.helpers.override_specs(override_spec)\n\n    return run_checks(filename, template, rules, regions)\n\n\ndef get_exit_code(matches):\n    \"\"\" Determine exit code \"\"\"\n    exit_code = 0\n    for match in matches:\n        if match.rule.id[0] == 'I':\n            exit_code = exit_code | 8\n        elif match.rule.id[0] == 'W':\n            exit_code = exit_code | 4\n        elif match.rule.id[0] == 'E':\n            exit_code = exit_code | 2\n\n    return exit_code\n\n\ndef get_formatter(fmt):\n    \"\"\" Get Formatter\"\"\"\n    formatter = {}\n    if fmt:\n        if fmt == 'quiet':\n            formatter = cfnlint.formatters.QuietFormatter()\n        elif fmt == 'parseable':\n            # pylint: disable=bad-option-value\n            formatter = cfnlint.formatters.ParseableFormatter()\n        elif fmt == 'json':\n            formatter = cfnlint.formatters.JsonFormatter()\n    else:\n        formatter = cfnlint.formatters.Formatter()\n\n    return formatter\n\n\ndef get_rules(rulesdir, ignore_rules, include_rules, configure_rules=None, include_experimental=False):\n    \"\"\"Get rules\"\"\"\n    rules = RulesCollection(ignore_rules, include_rules, configure_rules, include_experimental)\n    rules_dirs = [DEFAULT_RULESDIR] + rulesdir\n    try:\n        for rules_dir in rules_dirs:\n            rules.create_from_directory(rules_dir)\n    except OSError as e:\n        raise UnexpectedRuleException('Tried to append rules but got an error: %s' % str(e), 1)\n    return rules\n\n\ndef configure_logging(debug_logging):\n    \"\"\" Backwards compatibility for integrators \"\"\"\n    LOGGER.info('Update your integrations to use \"cfnlint.config.configure_logging\" instead')\n    cfnlint.config.configure_logging(debug_logging, False)\n\n\ndef get_args_filenames(cli_args):\n    \"\"\" Get Template Configuration items and set them as default values\"\"\"\n    try:\n        config = cfnlint.config.ConfigMixIn(cli_args)\n    except ValidationError as e:\n        LOGGER.error('Error parsing config file: %s', str(e))\n        exit(1)\n\n    fmt = config.format\n    formatter = get_formatter(fmt)\n\n    if config.update_specs:\n        cfnlint.maintenance.update_resource_specs()\n        exit(0)\n\n    if config.update_documentation:\n        # Get ALL rules (ignore the CLI settings))\n        documentation_rules = cfnlint.core.get_rules([], [], ['I', 'E', 'W'], {}, True)\n        cfnlint.maintenance.update_documentation(documentation_rules)\n        exit(0)\n\n    if config.update_iam_policies:\n        cfnlint.maintenance.update_iam_policies()\n        exit(0)\n\n    if config.listrules:\n        rules = cfnlint.core.get_rules(\n            config.append_rules,\n            config.ignore_checks,\n            config.include_checks,\n            config.configure_rules\n        )\n        print(rules)\n        exit(0)\n\n    if not sys.stdin.isatty() and not config.templates:\n        return(config, [None], formatter)\n\n    if not config.templates:\n        # Not specified, print the help\n        config.parser.print_help()\n        exit(1)\n\n    return(config, config.templates, formatter)\n\n\ndef get_template_rules(filename, args):\n    \"\"\" Get Template Configuration items and set them as default values\"\"\"\n\n    (template, matches) = cfnlint.decode.decode(filename, args.ignore_bad_template)\n\n    if matches:\n        return(template, [], matches)\n\n    args.template_args = template\n\n    rules = cfnlint.core.get_rules(\n        args.append_rules,\n        args.ignore_checks,\n        args.include_checks,\n        args.configure_rules,\n        args.include_experimental,\n    )\n\n    return(template, rules, [])\n\n\ndef run_checks(filename, template, rules, regions):\n    \"\"\"Run Checks against the template\"\"\"\n    if regions:\n        if not set(regions).issubset(set(REGIONS)):\n            unsupported_regions = list(set(regions).difference(set(REGIONS)))\n            msg = 'Regions %s are unsupported. Supported regions are %s' % (unsupported_regions, REGIONS)\n            raise InvalidRegionException(msg, 32)\n\n    matches = []\n\n    runner = cfnlint.Runner(rules, filename, template, regions)\n    matches.extend(runner.transform())\n    # Only do rule analysis if Transform was successful\n    if not matches:\n        try:\n            matches.extend(runner.run())\n        except Exception as err:  # pylint: disable=W0703\n            msg = 'Tried to process rules on file %s but got an error: %s' % (filename, str(err))\n            UnexpectedRuleException(msg, 1)\n    matches.sort(key=lambda x: (x.filename, x.linenumber, x.rule.id))\n\n    return(matches)\n", "path": "src/cfnlint/core.py"}]}