Skip to content

Commit dfdc6f9

Browse files
authored
chore(test) - Add in isort and update all files (aws-cloudformation#2507)
* Run isort on all the files * Format with black and double quotes
1 parent 7219fae commit dfdc6f9

File tree

371 files changed

+9265
-8122
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

371 files changed

+9265
-8122
lines changed

.git-blame-ignore-revs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Add in isort and ran on src/ and test/
2+
2952e5605d88959d6159f5e66df26f33f31748bf
3+
# Run black with double quotes on all files
4+
d2f61228a7eab70a25360fd75a13197f7752bb1f

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
[tool.black]
3-
skip-string-normalization = true
3+
skip-string-normalization = false
44

55
[tool.bandit]
66
skips = ["B101", "B303", "B310", "B110", "B112", "B324", "B404", "B603", "B607"]

src/cfnlint/__init__.py

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,84 +3,82 @@
33
SPDX-License-Identifier: MIT-0
44
"""
55
import logging
6-
import cfnlint.helpers
6+
77
import cfnlint.conditions
8+
import cfnlint.helpers
9+
import cfnlint.rules
10+
from cfnlint.decode.node import TemplateAttributeError, dict_node
811
from cfnlint.decorators.refactored import refactored
912
from cfnlint.graph import Graph
10-
from cfnlint.transform import Transform
11-
from cfnlint.decode.node import TemplateAttributeError
1213
from cfnlint.helpers import PSEUDOPARAMS
13-
from cfnlint.rules import RuleMatch as _RuleMatch
14-
from cfnlint.rules import Match as _Match
15-
from cfnlint.rules import RulesCollection as _RulesCollection
1614
from cfnlint.rules import CloudFormationLintRule as _CloudFormationLintRule
15+
from cfnlint.rules import Match as _Match
1716
from cfnlint.rules import ParseError as _ParseError
18-
from cfnlint.rules import TransformError as _TransformError
1917
from cfnlint.rules import RuleError as _RuleError
18+
from cfnlint.rules import RuleMatch as _RuleMatch
19+
from cfnlint.rules import RulesCollection as _RulesCollection
20+
from cfnlint.rules import TransformError as _TransformError
2021
from cfnlint.runner import Runner as _Runner
2122
from cfnlint.template import Template as _Template
22-
23-
24-
from cfnlint.decode.node import dict_node
25-
import cfnlint.rules
23+
from cfnlint.transform import Transform
2624

2725
LOGGER = logging.getLogger(__name__)
2826

2927

3028
@refactored(
31-
'RuleMatch is refactored and deprecated. Please use cfnlint.rules.RuleMatch'
29+
"RuleMatch is refactored and deprecated. Please use cfnlint.rules.RuleMatch"
3230
)
3331
class RuleMatch(_RuleMatch):
3432
"""Refactored class RuleMatch"""
3533

3634

37-
@refactored('Match is refactored and deprecated. Please use cfnlint.rules.Match')
35+
@refactored("Match is refactored and deprecated. Please use cfnlint.rules.Match")
3836
class Match(_Match):
3937
"""Refactored class Match"""
4038

4139

4240
@refactored(
43-
'RulesCollection is refactored and deprecated. Please use cfnlint.rules.RulesCollection'
41+
"RulesCollection is refactored and deprecated. Please use cfnlint.rules.RulesCollection"
4442
)
4543
class RulesCollection(_RulesCollection):
4644
"""Refactored class Rules Collection"""
4745

4846

4947
@refactored(
50-
'CloudFormationLintRule is refactored and deprecated. Please use cfnlint.rules.CloudFormationLintRule'
48+
"CloudFormationLintRule is refactored and deprecated. Please use cfnlint.rules.CloudFormationLintRule"
5149
)
5250
class CloudFormationLintRule(_CloudFormationLintRule):
5351
"""Refactored class Rules CloudFormationLintRule"""
5452

5553

5654
@refactored(
57-
'ParseError is refactored and deprecated. Please use cfnlint.rules.ParseError'
55+
"ParseError is refactored and deprecated. Please use cfnlint.rules.ParseError"
5856
)
5957
class ParseError(_ParseError):
6058
"""Refactored class Rules ParseError"""
6159

6260

6361
@refactored(
64-
'TransformError is refactored and deprecated. Please use cfnlint.rules.TransformError'
62+
"TransformError is refactored and deprecated. Please use cfnlint.rules.TransformError"
6563
)
6664
class TransformError(_TransformError):
6765
"""Refactored class Rules TransformError"""
6866

6967

7068
@refactored(
71-
'RuleError is refactored and deprecated. Please use cfnlint.rules.RuleError'
69+
"RuleError is refactored and deprecated. Please use cfnlint.rules.RuleError"
7270
)
7371
class RuleError(_RuleError):
7472
"""Refactored class Rules RuleError"""
7573

7674

7775
@refactored(
78-
'Template is refactored and deprecated. Please use Template in cfnlint.template'
76+
"Template is refactored and deprecated. Please use Template in cfnlint.template"
7977
)
8078
class Template(_Template):
8179
"""Refactored class Template"""
8280

8381

84-
@refactored('Runner is refactored and deprecated. Please use Runner in cfnlint.runner')
82+
@refactored("Runner is refactored and deprecated. Please use Runner in cfnlint.runner")
8583
class Runner(_Runner):
8684
"""Refactored class Runner"""

src/cfnlint/__main__.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,34 @@
22
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
SPDX-License-Identifier: MIT-0
44
"""
5-
import warnings
6-
import sys
75
import logging
8-
import cfnlint.core
6+
import sys
7+
import warnings
98

9+
import cfnlint.core
1010

11-
LOGGER = logging.getLogger('cfnlint')
11+
LOGGER = logging.getLogger("cfnlint")
1212

1313

1414
def main():
1515
if sys.version_info[:2] == (3, 4):
1616
warnings.warn(
17-
'Python 3.4 has reached end of life. '
18-
'cfn-lint has ended support for python 3.4 as of July 1st, 2020.',
17+
"Python 3.4 has reached end of life. "
18+
"cfn-lint has ended support for python 3.4 as of July 1st, 2020.",
1919
Warning,
2020
stacklevel=3,
2121
)
2222
elif sys.version_info[:2] == (3, 5):
2323
warnings.warn(
24-
'Python 3.5 has reached end of life. '
25-
'cfn-lint has ended support for python 3.5 as of August 1st, 2021.',
24+
"Python 3.5 has reached end of life. "
25+
"cfn-lint has ended support for python 3.5 as of August 1st, 2021.",
2626
Warning,
2727
stacklevel=3,
2828
)
2929
elif sys.version_info[:2] == (2, 7):
3030
warnings.warn(
31-
'Python 2.7 has reached end of life. '
32-
'cfn-lint will end support for python 2.7 on June 1st, 2020.',
31+
"Python 2.7 has reached end of life. "
32+
"cfn-lint will end support for python 2.7 on June 1st, 2020.",
3333
Warning,
3434
stacklevel=3,
3535
)
@@ -42,7 +42,7 @@ def main():
4242

4343
if matches_output:
4444
if args.output_file:
45-
with open(args.output_file, 'w', encoding='utf-8') as output_file:
45+
with open(args.output_file, "w", encoding="utf-8") as output_file:
4646
output_file.write(matches_output)
4747
else:
4848
print(matches_output)
@@ -53,7 +53,7 @@ def main():
5353
return e.exit_code
5454

5555

56-
if __name__ == '__main__':
56+
if __name__ == "__main__":
5757
try:
5858
sys.exit(main())
5959
except (ValueError, TypeError):

src/cfnlint/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
"""
55
from typing import List
66

7-
from cfnlint.rules import Match, RulesCollection
87
from cfnlint.config import configure_logging
98
from cfnlint.core import get_rules
109
from cfnlint.decode import decode_str
1110
from cfnlint.helpers import REGIONS
11+
from cfnlint.rules import Match, RulesCollection
1212
from cfnlint.runner import Runner
1313

1414
Matches = List[Match]
@@ -65,6 +65,6 @@ def lint_all(s: str) -> Matches:
6565
"""
6666
return lint(
6767
s=s,
68-
rules=get_rules([], [], ['I', 'W', 'E'], include_experimental=True),
68+
rules=get_rules([], [], ["I", "W", "E"], include_experimental=True),
6969
regions=REGIONS,
7070
)

0 commit comments

Comments
 (0)