Skip to content

Commit 2be7572

Browse files
Make yaml linting rules more strict (#772)
* ci: Use conventionalcommits preset in release note generator Align preset with recommended commit format that is mentioned in readme * style: Make yaml lint rules more strict * docs: Simplify PR template * style: Format example as yaml * style: Apply formatting consistent with yq output This will help ensure that automated verion bumps don't change formatting * ci: Don't change git user and don't format
1 parent 4fec5b3 commit 2be7572

16 files changed

+2653
-2677
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
<!--- Provide a general summary of your changes in the Title above -->
2-
31
## Description
4-
<!--- Describe your changes in detail -->
5-
6-
## Release Notes
7-
<!--- Why is this change required? What problem does it solve? -->
2+
<!--- Describe your changes in detail. -->
83
<!--- If it fixes an open issue, please link to the issue here. -->
9-
10-
## Screenshots (if appropriate):
11-
12-
## Types of Changes
13-
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
14-
- [ ] Bug fix (non-breaking change that fixes an issue)
15-
- [ ] New feature (non-breaking change that adds functionality)
16-
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

.releaserc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[
88
"@semantic-release/release-notes-generator",
99
{
10-
"preset": "angular",
10+
"preset": "conventionalcommits",
1111
"writerOpts": {
1212
"headerPartial": "## What's changed",
1313
"footerPartial": "\n**Full Changelog**:https://github.com/XeroAPI/Xero-OpenAPI/compare/{{previousTag}}...{{version}}"

.yamllint.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@ extends: default
22

33
rules:
44
line-length: disable
5-
trailing-spaces: disable
6-
indentation: disable
7-
colons: disable
8-
commas: disable
9-
new-line-at-end-of-file: disable
105
document-start: disable
116
truthy: disable
127
comments: disable
13-
new-lines: disable

scripts/update-version.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,10 @@
33
versionNumber=${1:?Version number is required as first argument}
44
branchName=${2:-master}
55

6-
if [ "${GITHUB_ACTIONS:-}" = "true" ]; then
7-
git config --global user.name "GitHub Actions"
8-
git config --global user.email "actions@github.com"
9-
fi
10-
116
git checkout "$branchName"
127

138
for file in xero*.yaml; do
14-
yq eval --no-colors --prettyPrint ".info.version = \"$versionNumber\"" -i "$file"
9+
yq -i ".info.version = \"$versionNumber\"" -i "$file"
1510
echo "updated version in $file to $versionNumber"
1611
done
1712

xero-app-store.yaml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ paths:
2222
operationId: getSubscription
2323
summary: Retrieves a subscription for a given subscriptionId
2424
parameters:
25-
- $ref: '#/components/parameters/subscriptionId'
25+
- $ref: "#/components/parameters/subscriptionId"
2626
responses:
2727
"200":
2828
description: Success - return response of unique Subscription object
2929
content:
3030
application/json:
3131
schema:
32-
$ref: '#/components/schemas/Subscription'
32+
$ref: "#/components/schemas/Subscription"
3333
example:
3434
currentPeriodEnd: 2021-07-20T03:13:48
3535
endDate: 2021-07-20T03:13:48
@@ -72,7 +72,7 @@ paths:
7272
content:
7373
application/json:
7474
schema:
75-
$ref: '#/components/schemas/ProblemDetails'
75+
$ref: "#/components/schemas/ProblemDetails"
7676
description: When a failure occurs in the endpoint
7777
security:
7878
- OAuth2:
@@ -84,16 +84,16 @@ paths:
8484
operationId: postUsageRecords
8585
summary: Send metered usage belonging to this subscription and subscription item
8686
parameters:
87-
- $ref: '#/components/parameters/idempotencyKey'
88-
- $ref: '#/components/parameters/subscriptionId'
89-
- $ref: '#/components/parameters/subscriptionItemId'
87+
- $ref: "#/components/parameters/idempotencyKey"
88+
- $ref: "#/components/parameters/subscriptionId"
89+
- $ref: "#/components/parameters/subscriptionItemId"
9090
responses:
9191
"200":
9292
description: Success - return response of the record submitted
9393
content:
9494
application/json:
9595
schema:
96-
$ref: '#/components/schemas/UsageRecord'
96+
$ref: "#/components/schemas/UsageRecord"
9797
example:
9898
usageRecordId: 2a90f7d9-4c10-4a23-9c34-b47225167a48
9999
subscriptionId: 391be708-878a-4741-acfb-c0bc9a165bdb
@@ -107,7 +107,7 @@ paths:
107107
content:
108108
application/json:
109109
schema:
110-
$ref: '#/components/schemas/ProblemDetails'
110+
$ref: "#/components/schemas/ProblemDetails"
111111
description: When a failure occurs in the endpoint
112112
security:
113113
- OAuth2:
@@ -116,7 +116,7 @@ paths:
116116
content:
117117
application/json:
118118
schema:
119-
$ref: '#/components/schemas/CreateUsageRecord'
119+
$ref: "#/components/schemas/CreateUsageRecord"
120120
example:
121121
timestamp: 2022-01-21T13:01:00
122122
quantity: 10
@@ -129,17 +129,17 @@ paths:
129129
operationId: putUsageRecords
130130
summary: Update and existing metered usage belonging to this subscription and subscription item
131131
parameters:
132-
- $ref: '#/components/parameters/idempotencyKey'
133-
- $ref: '#/components/parameters/subscriptionId'
134-
- $ref: '#/components/parameters/subscriptionItemId'
135-
- $ref: '#/components/parameters/usageRecordId'
132+
- $ref: "#/components/parameters/idempotencyKey"
133+
- $ref: "#/components/parameters/subscriptionId"
134+
- $ref: "#/components/parameters/subscriptionItemId"
135+
- $ref: "#/components/parameters/usageRecordId"
136136
responses:
137137
"200":
138138
description: Success - return response of the modified record
139139
content:
140140
application/json:
141141
schema:
142-
$ref: '#/components/schemas/UsageRecord'
142+
$ref: "#/components/schemas/UsageRecord"
143143
example:
144144
usageRecordId: 2a90f7d9-4c10-4a23-9c34-b47225167a48
145145
subscriptionId: 391be708-878a-4741-acfb-c0bc9a165bdb
@@ -153,7 +153,7 @@ paths:
153153
content:
154154
application/json:
155155
schema:
156-
$ref: '#/components/schemas/ProblemDetails'
156+
$ref: "#/components/schemas/ProblemDetails"
157157
description: When a failure occurs in the endpoint
158158
security:
159159
- OAuth2:
@@ -162,7 +162,7 @@ paths:
162162
content:
163163
application/json:
164164
schema:
165-
$ref: '#/components/schemas/UpdateUsageRecord'
165+
$ref: "#/components/schemas/UpdateUsageRecord"
166166
example:
167167
quantity: 10
168168
description: Contains the quantity for the usage record to update
@@ -174,14 +174,14 @@ paths:
174174
operationId: getUsageRecords
175175
summary: Gets all usage records related to the subscription
176176
parameters:
177-
- $ref: '#/components/parameters/subscriptionId'
177+
- $ref: "#/components/parameters/subscriptionId"
178178
responses:
179179
"200":
180180
description: Success - return a list of all usage record submitted against this subscription for this subscription period
181181
content:
182182
application/json:
183183
schema:
184-
$ref: '#/components/schemas/UsageRecordsList'
184+
$ref: "#/components/schemas/UsageRecordsList"
185185
example:
186186
usageRecords:
187187
- usageRecordId: 206100d3-e18b-4c59-9372-e98e4367a73f
@@ -204,7 +204,7 @@ paths:
204204
content:
205205
application/json:
206206
schema:
207-
$ref: '#/components/schemas/ProblemDetails'
207+
$ref: "#/components/schemas/ProblemDetails"
208208
description: When a failure occurs in the endpoint
209209
security:
210210
- OAuth2:
@@ -228,7 +228,7 @@ components:
228228
description: Unique identifier for Subscription object
229229
example: 00000000-0000-0000-0000-000000000000
230230
x-example-java: UUID.fromString("00000000-0000-0000-0000-000000000000")
231-
x-example-php: '&quot;00000000-0000-0000-0000-000000000000&quot;'
231+
x-example-php: "&quot;00000000-0000-0000-0000-000000000000&quot;"
232232
x-example-csharp: Guid.Parse("00000000-0000-0000-0000-000000000000");
233233
schema:
234234
type: string
@@ -241,7 +241,7 @@ components:
241241
description: The unique identifier of the subscriptionItem
242242
example: 00000000-0000-0000-0000-000000000000
243243
x-example-java: UUID.fromString("00000000-0000-0000-0000-000000000000")
244-
x-example-php: '&quot;00000000-0000-0000-0000-000000000000&quot;'
244+
x-example-php: "&quot;00000000-0000-0000-0000-000000000000&quot;"
245245
x-example-csharp: Guid.Parse("00000000-0000-0000-0000-000000000000");
246246
schema:
247247
type: string
@@ -254,7 +254,7 @@ components:
254254
description: The unique identifier of the usage record
255255
example: 00000000-0000-0000-0000-000000000000
256256
x-example-java: UUID.fromString("00000000-0000-0000-0000-000000000000")
257-
x-example-php: '&quot;00000000-0000-0000-0000-000000000000&quot;'
257+
x-example-php: "&quot;00000000-0000-0000-0000-000000000000&quot;"
258258
x-example-csharp: Guid.Parse("00000000-0000-0000-0000-000000000000");
259259
schema:
260260
type: string
@@ -294,7 +294,7 @@ components:
294294
description: List of plans for the subscription.
295295
type: array
296296
items:
297-
$ref: '#/components/schemas/Plan'
297+
$ref: "#/components/schemas/Plan"
298298
startDate:
299299
description: Date when the subscription was first created.
300300
format: date-time
@@ -343,7 +343,7 @@ components:
343343
List of the subscription items belonging to the plan. It does not
344344
include cancelled subscription items.
345345
items:
346-
$ref: '#/components/schemas/SubscriptionItem'
346+
$ref: "#/components/schemas/SubscriptionItem"
347347
type: array
348348
required:
349349
- id
@@ -398,10 +398,10 @@ components:
398398
type: string
399399
price:
400400
description: The price of the product subscribed to.
401-
$ref: '#/components/schemas/Price'
401+
$ref: "#/components/schemas/Price"
402402
product:
403403
description: The product subscribed to.
404-
$ref: '#/components/schemas/Product'
404+
$ref: "#/components/schemas/Product"
405405
quantity:
406406
description: The quantity of the item. For a fixed product, it is 1. For a per-seat product, it is a positive integer. For metered products, it is always null.
407407
type: integer
@@ -508,7 +508,7 @@ components:
508508
usageRecords:
509509
description: A collection of usage records
510510
items:
511-
$ref: '#/components/schemas/UsageRecord'
511+
$ref: "#/components/schemas/UsageRecord"
512512
type: array
513513
required:
514514
- usageRecords

0 commit comments

Comments
 (0)