Skip to content

Commit 2c661d6

Browse files
authored
Update pre-commit hooks (#268)
* Update pre-commit * Bump version: 3.4.5 → 3.4.6
1 parent ad9f335 commit 2c661d6

32 files changed

Lines changed: 184 additions & 86 deletions

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[bumpversion]
2-
current_version = 3.4.5
2+
current_version = 3.4.6
33
commit = True
44
tag = False

.github/workflows/unit-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
with:
1818
python-version: '3.x'
1919
cache: 'pip' # caching pip dependencies
20-
- run: pip install -r requirements.txt
20+
- run: pip install pre-commit
2121
- uses: actions/cache@v3
2222
env:
2323
cache-name: pre-commit

.pre-commit-config.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ repos:
55

66
# General
77
- repo: https://github.com/pre-commit/pre-commit-hooks
8-
rev: v4.4.0
8+
rev: v5.0.0
99
hooks:
1010
- id: check-case-conflict
1111
- id: detect-private-key
@@ -30,13 +30,13 @@ repos:
3030

3131
# CloudFormation
3232
- repo: https://github.com/aws-cloudformation/cfn-lint
33-
rev: v0.79.7
33+
rev: v1.20.2
3434
hooks:
3535
- id: cfn-lint-rc
3636
files: code/solutions/.*\.(ya?ml|template)$
3737

3838
- repo: https://github.com/aws-cloudformation/rain
39-
rev: v1.4.4
39+
rev: v1.19.0
4040
hooks:
4141
- id: cfn-format
4242
files: code/solutions/.*\.(ya?ml|template)$
@@ -55,27 +55,27 @@ repos:
5555

5656
# Python
5757
- repo: https://github.com/pycqa/pylint
58-
rev: v3.0.0a7
58+
rev: v3.3.2
5959
hooks:
6060
- id: pylint
6161
args:
6262
- --errors-only
6363
- --disable=E0401
6464

6565
- repo: https://github.com/psf/black
66-
rev: 23.7.0
66+
rev: 24.10.0
6767
hooks:
6868
- id: black
6969

7070
- repo: https://github.com/PyCQA/isort
71-
rev: 5.12.0
71+
rev: 5.13.2
7272
hooks:
7373
- id: isort
7474
args: ["--profile", "black"]
7575

7676
# Shell check
7777
- repo: https://github.com/shellcheck-py/shellcheck-py
78-
rev: v0.9.0.5
78+
rev: v0.10.0.1
7979
hooks:
8080
- id: shellcheck
8181
files: solutions/.*\.(sh)$

code/solutions/architecting-templates/application-blue-green.template

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -99,22 +99,22 @@ Resources:
9999
Properties:
100100
DesiredCapacity: 2
101101
LaunchTemplate:
102-
LaunchTemplateId: !Ref 'LaunchTemplate'
102+
LaunchTemplateId: !Ref LaunchTemplate
103103
Version: !GetAtt LaunchTemplate.LatestVersionNumber
104104
MaxSize: 4
105105
MinSize: 2
106106
Tags:
107107
- Key: Name
108108
PropagateAtLaunch: true
109-
Value: !Ref 'NameTagValue'
109+
Value: !Ref NameTagValue
110110
- Key: AppName
111111
PropagateAtLaunch: true
112-
Value: !Ref 'AppNameTagValue'
112+
Value: !Ref AppNameTagValue
113113
- Key: Env
114114
PropagateAtLaunch: true
115-
Value: !Ref 'Env'
115+
Value: !Ref Env
116116
TargetGroupARNs:
117-
- !Ref 'TargetGroup'
117+
- !Ref TargetGroup
118118
VPCZoneIdentifier:
119119
- !ImportValue
120120
Fn::Sub: ${NetworkStackName}-PrivateSubnet1Id
@@ -126,9 +126,9 @@ Resources:
126126
Properties:
127127
DefaultActions:
128128
- Order: 1
129-
TargetGroupArn: !Ref 'TargetGroup'
129+
TargetGroupArn: !Ref TargetGroup
130130
Type: forward
131-
LoadBalancerArn: !Ref 'LoadBalancer'
131+
LoadBalancerArn: !Ref LoadBalancer
132132
Port: 80
133133
Protocol: HTTP
134134

@@ -188,8 +188,8 @@ Resources:
188188
ensureRunning: true
189189
Properties:
190190
LaunchTemplateData:
191-
ImageId: !Ref 'LatestAmiId'
192-
InstanceType: !Ref 'InstanceType'
191+
ImageId: !Ref LatestAmiId
192+
InstanceType: !Ref InstanceType
193193
SecurityGroupIds:
194194
- !ImportValue
195195
Fn::Sub: ${SecurityGroupStackName}-AppInstancesSecurityGroupId
@@ -203,11 +203,11 @@ Resources:
203203
- ResourceType: launch-template
204204
Tags:
205205
- Key: Name
206-
Value: !Ref 'NameTagValue'
206+
Value: !Ref NameTagValue
207207
- Key: AppName
208-
Value: !Ref 'AppNameTagValue'
208+
Value: !Ref AppNameTagValue
209209
- Key: Env
210-
Value: !Ref 'Env'
210+
Value: !Ref Env
211211

212212
LoadBalancer:
213213
Type: AWS::ElasticLoadBalancingV2::LoadBalancer
@@ -224,11 +224,11 @@ Resources:
224224
Fn::Sub: ${NetworkStackName}-PublicSubnet2Id
225225
Tags:
226226
- Key: Name
227-
Value: !Ref 'NameTagValue'
227+
Value: !Ref NameTagValue
228228
- Key: AppName
229-
Value: !Ref 'AppNameTagValue'
229+
Value: !Ref AppNameTagValue
230230
- Key: Env
231-
Value: !Ref 'Env'
231+
Value: !Ref Env
232232
Type: application
233233

234234
RecordSet:
@@ -242,9 +242,9 @@ Resources:
242242
Fn::Sub: ${HostedZoneStackName}-HostedZoneId
243243
Name: !ImportValue
244244
Fn::Sub: ${HostedZoneStackName}-HostedZoneName
245-
SetIdentifier: !Sub '${AppNameTagValue} application managed with the ${AWS::StackName} stack.'
245+
SetIdentifier: !Sub ${AppNameTagValue} application managed with the ${AWS::StackName} stack.
246246
Type: A
247-
Weight: !Ref 'RecordSetWeight'
247+
Weight: !Ref RecordSetWeight
248248

249249
TargetGroup:
250250
Type: AWS::ElasticLoadBalancingV2::TargetGroup
@@ -259,11 +259,11 @@ Resources:
259259
Protocol: HTTP
260260
Tags:
261261
- Key: Name
262-
Value: !Ref 'NameTagValue'
262+
Value: !Ref NameTagValue
263263
- Key: AppName
264-
Value: !Ref 'AppNameTagValue'
264+
Value: !Ref AppNameTagValue
265265
- Key: Env
266-
Value: !Ref 'Env'
266+
Value: !Ref Env
267267
TargetType: instance
268268
UnhealthyThresholdCount: 2
269269
VpcId: !ImportValue
@@ -272,4 +272,4 @@ Resources:
272272
Outputs:
273273
AppUrl:
274274
Description: URL of the sample app.
275-
Value: !Sub 'http://${LoadBalancer.DNSName}'
275+
Value: !Sub http://${LoadBalancer.DNSName}

code/solutions/conditions/condition-resource-property.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,7 @@ Resources:
2626
Type: AWS::EC2::Instance
2727
Properties:
2828
ImageId: !Ref LatestAmiId
29-
InstanceType: !If [IsProduction, t2.small, t2.micro]
29+
InstanceType: !If
30+
- IsProduction
31+
- t2.small
32+
- t2.micro

code/solutions/cross-stacks/ec2.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,18 @@ Resources:
110110
SubnetId: !ImportValue cfn-workshop-PublicSubnet1
111111
IamInstanceProfile: !ImportValue cfn-workshop-WebServerInstanceProfile
112112
ImageId: !Ref AmiID
113-
InstanceType: !FindInMap [EnvironmentToInstanceType, !Ref EnvironmentType, InstanceType]
113+
InstanceType: !FindInMap
114+
- EnvironmentToInstanceType
115+
- !Ref EnvironmentType
116+
- InstanceType
114117
SecurityGroupIds:
115118
- !Ref WebServerSecurityGroup
116119
Tags:
117120
- Key: Name
118-
Value: !Join [' ', [!Ref EnvironmentType, Web Server]]
121+
Value: !Join
122+
- ' '
123+
- - !Ref EnvironmentType
124+
- Web Server
119125
UserData: !Base64
120126
Fn::Sub: |
121127
#!/bin/bash -xe

code/solutions/cross-stacks/vpc.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ Resources:
5050
Properties:
5151
CidrBlock: !Ref PublicSubnet1Cidr
5252
VpcId: !Ref VPC
53-
AvailabilityZone: !Select [0, !Ref AvailabilityZones]
53+
AvailabilityZone: !Select
54+
- 0
55+
- !Ref AvailabilityZones
5456
MapPublicIpOnLaunch: true
5557
Tags:
5658
- Key: Name
@@ -86,7 +88,9 @@ Resources:
8688
Properties:
8789
CidrBlock: !Ref PublicSubnet2Cidr
8890
VpcId: !Ref VPC
89-
AvailabilityZone: !Select [1, !Ref AvailabilityZones]
91+
AvailabilityZone: !Select
92+
- 1
93+
- !Ref AvailabilityZones
9094
MapPublicIpOnLaunch: true
9195
Tags:
9296
- Key: Name

code/solutions/dynamic-references/database.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ Resources:
3030
rules_to_suppress:
3131
- id: F80
3232
- id: F27
33+
cfn-lint:
34+
config:
35+
ignore_checks:
36+
- W1011
3337
Properties:
3438
DBInstanceClass: db.t3.micro
3539
AllocatedStorage: "20"

code/solutions/dynamic-references/ec2-instance.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ Resources:
66
Instance:
77
Type: AWS::EC2::Instance
88
Properties:
9-
AvailabilityZone: !Select ["0", !GetAZs ""]
9+
AvailabilityZone: !Select
10+
- 0
11+
- !GetAZs
12+
Ref: AWS::Region
1013
InstanceType: t2.micro
1114
ImageId: '{{resolve:ssm:/golden-images/amazon-linux-2}}'

code/solutions/dynamic-references/lambda-function.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Resources:
1616
- lambda.amazonaws.com
1717
Version: "2012-10-17"
1818
ManagedPolicyArns:
19-
- !Sub 'arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole'
19+
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
2020
Path: /
2121

2222
DatabaseFunction:

0 commit comments

Comments
 (0)