Skip to content

Commit 499ed7f

Browse files
authored
Add .graphql support (#111)
* Bootstrap * Add GraphQL tests to `initial` and `expected` * Add missing comma
1 parent e80cdac commit 499ed7f

4 files changed

Lines changed: 32 additions & 0 deletions

File tree

main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ func licenseHeader(path string, tmpl *template.Template, data licenseData) ([]by
323323
".bzl", ".bazel", "build", ".build",
324324
".dockerfile", "dockerfile",
325325
".ex", ".exs",
326+
".graphql",
326327
".jl",
327328
".nix",
328329
".pl",

main_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ func TestLicenseHeader(t *testing.T) {
348348
"f.bzl", "f.bazel", "build", "f.build",
349349
"f.dockerfile", "dockerfile",
350350
"f.ex", "f.exs",
351+
"f.graphql",
351352
"f.jl",
352353
"f.nix",
353354
"f.pl",

testdata/expected/file.graphql

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2018 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
query HeroNameAndFriends {
16+
hero {
17+
name
18+
friends {
19+
name
20+
}
21+
}
22+
}

testdata/initial/file.graphql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
query HeroNameAndFriends {
2+
hero {
3+
name
4+
friends {
5+
name
6+
}
7+
}
8+
}

0 commit comments

Comments
 (0)