Skip to content

Commit e95ed34

Browse files
authored
Check for superfluous trailing whitespace (#636)
1 parent 330c142 commit e95ed34

File tree

4 files changed

+55
-50
lines changed

4 files changed

+55
-50
lines changed

Diff for: .github/workflows/go.yml

+5
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ jobs:
9191
name: nilness
9292
run: go run golang.org/x/tools/go/analysis/passes/nilness/cmd/nilness@latest ./...
9393

94+
- if: runner.os == 'Linux'
95+
name: Check for superfluous trailing whitespace
96+
run: |
97+
! grep -IErn '\s$' --exclude-dir={.git,target,pgdata}
98+
9499
- if: runner.os == 'Linux'
95100
name: Missing specification object link to definition
96101
run: |

Diff for: openapi3/testdata/link-example.yaml

+48-48
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
openapi: 3.0.0
2-
info:
2+
info:
33
title: Link Example
44
version: 1.0.0
5-
paths:
6-
/2.0/users/{username}:
7-
get:
5+
paths:
6+
/2.0/users/{username}:
7+
get:
88
operationId: getUserByName
9-
parameters:
9+
parameters:
1010
- name: username
1111
in: path
1212
required: true
1313
schema:
1414
type: string
15-
responses:
15+
responses:
1616
'200':
1717
description: The User
1818
content:
1919
application/json:
20-
schema:
20+
schema:
2121
$ref: '#/components/schemas/user'
2222
links:
2323
userRepositories:
@@ -34,7 +34,7 @@ paths:
3434
responses:
3535
'200':
3636
description: repositories owned by the supplied user
37-
content:
37+
content:
3838
application/json:
3939
schema:
4040
type: array
@@ -43,10 +43,10 @@ paths:
4343
links:
4444
userRepository:
4545
$ref: '#/components/links/UserRepository'
46-
/2.0/repositories/{username}/{slug}:
47-
get:
46+
/2.0/repositories/{username}/{slug}:
47+
get:
4848
operationId: getRepository
49-
parameters:
49+
parameters:
5050
- name: username
5151
in: path
5252
required: true
@@ -57,20 +57,20 @@ paths:
5757
required: true
5858
schema:
5959
type: string
60-
responses:
60+
responses:
6161
'200':
6262
description: The repository
6363
content:
64-
application/json:
65-
schema:
64+
application/json:
65+
schema:
6666
$ref: '#/components/schemas/repository'
6767
links:
6868
repositoryPullRequests:
6969
$ref: '#/components/links/RepositoryPullRequests'
70-
/2.0/repositories/{username}/{slug}/pullrequests:
71-
get:
70+
/2.0/repositories/{username}/{slug}/pullrequests:
71+
get:
7272
operationId: getPullRequestsByRepository
73-
parameters:
73+
parameters:
7474
- name: username
7575
in: path
7676
required: true
@@ -85,23 +85,23 @@ paths:
8585
in: query
8686
schema:
8787
type: string
88-
enum:
88+
enum:
8989
- open
9090
- merged
9191
- declined
92-
responses:
92+
responses:
9393
'200':
9494
description: an array of pull request objects
9595
content:
96-
application/json:
97-
schema:
96+
application/json:
97+
schema:
9898
type: array
99-
items:
99+
items:
100100
$ref: '#/components/schemas/pullrequest'
101-
/2.0/repositories/{username}/{slug}/pullrequests/{pid}:
102-
get:
101+
/2.0/repositories/{username}/{slug}/pullrequests/{pid}:
102+
get:
103103
operationId: getPullRequestsById
104-
parameters:
104+
parameters:
105105
- name: username
106106
in: path
107107
required: true
@@ -117,20 +117,20 @@ paths:
117117
required: true
118118
schema:
119119
type: string
120-
responses:
120+
responses:
121121
'200':
122122
description: a pull request object
123123
content:
124-
application/json:
125-
schema:
124+
application/json:
125+
schema:
126126
$ref: '#/components/schemas/pullrequest'
127127
links:
128128
pullRequestMerge:
129129
$ref: '#/components/links/PullRequestMerge'
130-
/2.0/repositories/{username}/{slug}/pullrequests/{pid}/merge:
131-
post:
130+
/2.0/repositories/{username}/{slug}/pullrequests/{pid}/merge:
131+
post:
132132
operationId: mergePullRequest
133-
parameters:
133+
parameters:
134134
- name: username
135135
in: path
136136
required: true
@@ -146,7 +146,7 @@ paths:
146146
required: true
147147
schema:
148148
type: string
149-
responses:
149+
responses:
150150
'204':
151151
description: the PR was successfully merged
152152
components:
@@ -165,7 +165,7 @@ components:
165165
RepositoryPullRequests:
166166
# returns '#/components/schemas/pullrequest'
167167
operationId: getPullRequestsByRepository
168-
parameters:
168+
parameters:
169169
username: $response.body#/owner/username
170170
slug: $response.body#/slug
171171
PullRequestMerge:
@@ -175,29 +175,29 @@ components:
175175
username: $response.body#/author/username
176176
slug: $response.body#/repository/slug
177177
pid: $response.body#/id
178-
schemas:
179-
user:
178+
schemas:
179+
user:
180180
type: object
181-
properties:
182-
username:
181+
properties:
182+
username:
183183
type: string
184-
uuid:
184+
uuid:
185185
type: string
186-
repository:
186+
repository:
187187
type: object
188-
properties:
189-
slug:
188+
properties:
189+
slug:
190190
type: string
191-
owner:
191+
owner:
192192
$ref: '#/components/schemas/user'
193-
pullrequest:
193+
pullrequest:
194194
type: object
195-
properties:
196-
id:
195+
properties:
196+
id:
197197
type: integer
198-
title:
198+
title:
199199
type: string
200-
repository:
200+
repository:
201201
$ref: '#/components/schemas/repository'
202-
author:
202+
author:
203203
$ref: '#/components/schemas/user'

Diff for: openapi3/testdata/lxkns.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# https://raw.githubusercontent.com/thediveo/lxkns/71e8fb5e40c612ecc89d972d211221137e92d5f0/api/openapi-spec/lxkns.yaml
22
openapi: 3.0.2
3-
security:
3+
security:
44
- {}
55
info:
66
title: lxkns

Diff for: openapi3filter/testdata/petstore.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ paths:
3838
minimum: 1
3939
requestBody:
4040
required: true
41-
content:
41+
content:
4242
'application/json':
4343
schema:
4444
$ref: '#/components/schemas/Pet'

0 commit comments

Comments
 (0)