diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 96be6fa..7403ca9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -23,7 +23,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go: [ '1.18', '1.19', '1.20', '1.21' ] + go: [ '1.18', '1.19', '1.20', '1.21', '1.22' ] steps: - uses: actions/checkout@v3 @@ -32,13 +32,16 @@ jobs: with: go-version: ${{ matrix.go }} cache: true - + - name: Go Mod Tidy run: go mod tidy + - name: Check licenses + run: make addlicense_check + - name: Go Vet run: go vet - + - name: Test run: go test -v ./... diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5bd0786..15400aa 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,3 +1,17 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + name: Github Actions for Releases on: diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index a3d0e1c..e3319d8 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -1,3 +1,17 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + - id: yamlfmt name: yamlfmt description: This hook uses github.com/google/yamlfmt to format yaml files. Requires golang >1.18 to be installed. diff --git a/Makefile b/Makefile index 283c810..e7d4bd3 100644 --- a/Makefile +++ b/Makefile @@ -52,3 +52,7 @@ install_tools: .PHONY: addlicense addlicense: addlicense -c "Google LLC" -l apache . + +.PHONY: addlicense_check +addlicense_check: + addlicense -check -c "Google LLC" -l apache . diff --git a/cmd/yamlfmt/config.go b/cmd/yamlfmt/config.go index 544f899..27e4ddf 100644 --- a/cmd/yamlfmt/config.go +++ b/cmd/yamlfmt/config.go @@ -1,3 +1,17 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package main import ( diff --git a/content_analyzer.go b/content_analyzer.go index 10da3de..4083e6b 100644 --- a/content_analyzer.go +++ b/content_analyzer.go @@ -1,3 +1,17 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package yamlfmt import ( diff --git a/content_analyzer_test.go b/content_analyzer_test.go index 0c966a5..d3f524d 100644 --- a/content_analyzer_test.go +++ b/content_analyzer_test.go @@ -1,3 +1,17 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package yamlfmt_test import ( diff --git a/engine.go b/engine.go index d6624be..da66578 100644 --- a/engine.go +++ b/engine.go @@ -1,3 +1,17 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package yamlfmt import ( diff --git a/engine/output.go b/engine/output.go index b00c833..383f425 100644 --- a/engine/output.go +++ b/engine/output.go @@ -1,3 +1,17 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package engine import ( diff --git a/formatter.go b/formatter.go index b143185..52b3f5c 100644 --- a/formatter.go +++ b/formatter.go @@ -1,3 +1,17 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package yamlfmt import "fmt" diff --git a/formatters/basic/errors.go b/formatters/basic/errors.go index 8a2fdd4..02c0a89 100644 --- a/formatters/basic/errors.go +++ b/formatters/basic/errors.go @@ -1,3 +1,17 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package basic import "fmt" diff --git a/integrationtest/command/command_test.go b/integrationtest/command/command_test.go index 9030b4a..86f33df 100644 --- a/integrationtest/command/command_test.go +++ b/integrationtest/command/command_test.go @@ -1,3 +1,17 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //go:build integration_test package command diff --git a/integrationtest/command/testcase.go b/integrationtest/command/testcase.go index 43a4319..6868f26 100644 --- a/integrationtest/command/testcase.go +++ b/integrationtest/command/testcase.go @@ -1,3 +1,17 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //go:build integration_test package command diff --git a/integrationtest/command/testdata/dry/after/a.yaml b/integrationtest/command/testdata/dry/after/a.yaml index a8926a5..e3fd523 100755 --- a/integrationtest/command/testdata/dry/after/a.yaml +++ b/integrationtest/command/testdata/dry/after/a.yaml @@ -1 +1,15 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + a: 1 diff --git a/integrationtest/command/testdata/dry/before/a.yaml b/integrationtest/command/testdata/dry/before/a.yaml index a8926a5..e3fd523 100644 --- a/integrationtest/command/testdata/dry/before/a.yaml +++ b/integrationtest/command/testdata/dry/before/a.yaml @@ -1 +1,15 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + a: 1 diff --git a/integrationtest/command/testdata/dry_quiet/after/a.yaml b/integrationtest/command/testdata/dry_quiet/after/a.yaml index a8926a5..e3fd523 100755 --- a/integrationtest/command/testdata/dry_quiet/after/a.yaml +++ b/integrationtest/command/testdata/dry_quiet/after/a.yaml @@ -1 +1,15 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + a: 1 diff --git a/integrationtest/command/testdata/dry_quiet/before/a.yaml b/integrationtest/command/testdata/dry_quiet/before/a.yaml index a8926a5..e3fd523 100644 --- a/integrationtest/command/testdata/dry_quiet/before/a.yaml +++ b/integrationtest/command/testdata/dry_quiet/before/a.yaml @@ -1 +1,15 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + a: 1 diff --git a/integrationtest/command/testdata/gitignore/after/not_this_file.yaml b/integrationtest/command/testdata/gitignore/after/not_this_file.yaml index 967c940..db310a4 100755 --- a/integrationtest/command/testdata/gitignore/after/not_this_file.yaml +++ b/integrationtest/command/testdata/gitignore/after/not_this_file.yaml @@ -1,2 +1,16 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + a: b: 1 \ No newline at end of file diff --git a/integrationtest/command/testdata/gitignore/after/this_file.yaml b/integrationtest/command/testdata/gitignore/after/this_file.yaml index 28f410a..5c2ddd0 100755 --- a/integrationtest/command/testdata/gitignore/after/this_file.yaml +++ b/integrationtest/command/testdata/gitignore/after/this_file.yaml @@ -1,2 +1,16 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + a: b: 1 diff --git a/integrationtest/command/testdata/gitignore/before/not_this_file.yaml b/integrationtest/command/testdata/gitignore/before/not_this_file.yaml index 967c940..db310a4 100644 --- a/integrationtest/command/testdata/gitignore/before/not_this_file.yaml +++ b/integrationtest/command/testdata/gitignore/before/not_this_file.yaml @@ -1,2 +1,16 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + a: b: 1 \ No newline at end of file diff --git a/integrationtest/command/testdata/gitignore/before/this_file.yaml b/integrationtest/command/testdata/gitignore/before/this_file.yaml index 967c940..db310a4 100644 --- a/integrationtest/command/testdata/gitignore/before/this_file.yaml +++ b/integrationtest/command/testdata/gitignore/before/this_file.yaml @@ -1,2 +1,16 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + a: b: 1 \ No newline at end of file diff --git a/integrationtest/command/testdata/include_document_start/after/x.yaml b/integrationtest/command/testdata/include_document_start/after/x.yaml index 449551a..3abd1ce 100755 --- a/integrationtest/command/testdata/include_document_start/after/x.yaml +++ b/integrationtest/command/testdata/include_document_start/after/x.yaml @@ -1,3 +1,17 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + --- hello: world: 1 diff --git a/integrationtest/command/testdata/include_document_start/before/x.yaml b/integrationtest/command/testdata/include_document_start/before/x.yaml index 1a64521..6487007 100644 --- a/integrationtest/command/testdata/include_document_start/before/x.yaml +++ b/integrationtest/command/testdata/include_document_start/before/x.yaml @@ -1,2 +1,16 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + hello: world: 1 diff --git a/integrationtest/command/testdata/line_output/after/x.yaml b/integrationtest/command/testdata/line_output/after/x.yaml index 967c940..db310a4 100755 --- a/integrationtest/command/testdata/line_output/after/x.yaml +++ b/integrationtest/command/testdata/line_output/after/x.yaml @@ -1,2 +1,16 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + a: b: 1 \ No newline at end of file diff --git a/integrationtest/command/testdata/line_output/before/x.yaml b/integrationtest/command/testdata/line_output/before/x.yaml index 967c940..db310a4 100644 --- a/integrationtest/command/testdata/line_output/before/x.yaml +++ b/integrationtest/command/testdata/line_output/before/x.yaml @@ -1,2 +1,16 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + a: b: 1 \ No newline at end of file diff --git a/integrationtest/command/testdata/lint/after/a.yaml b/integrationtest/command/testdata/lint/after/a.yaml index 967c940..db310a4 100755 --- a/integrationtest/command/testdata/lint/after/a.yaml +++ b/integrationtest/command/testdata/lint/after/a.yaml @@ -1,2 +1,16 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + a: b: 1 \ No newline at end of file diff --git a/integrationtest/command/testdata/lint/before/a.yaml b/integrationtest/command/testdata/lint/before/a.yaml index 967c940..db310a4 100644 --- a/integrationtest/command/testdata/lint/before/a.yaml +++ b/integrationtest/command/testdata/lint/before/a.yaml @@ -1,2 +1,16 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + a: b: 1 \ No newline at end of file diff --git a/integrationtest/command/testdata/path_arg/after/x.yaml b/integrationtest/command/testdata/path_arg/after/x.yaml index 85f21a0..3a18d6f 100755 --- a/integrationtest/command/testdata/path_arg/after/x.yaml +++ b/integrationtest/command/testdata/path_arg/after/x.yaml @@ -1,2 +1,16 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + 6tark: does: 64 diff --git a/integrationtest/command/testdata/path_arg/before/x.yaml b/integrationtest/command/testdata/path_arg/before/x.yaml index 8303902..d89d90a 100644 --- a/integrationtest/command/testdata/path_arg/before/x.yaml +++ b/integrationtest/command/testdata/path_arg/before/x.yaml @@ -1,2 +1,16 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + 6tark: does: 64 diff --git a/internal/assert/assert.go b/internal/assert/assert.go index 4372a15..f3f93f0 100644 --- a/internal/assert/assert.go +++ b/internal/assert/assert.go @@ -1,3 +1,17 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package assert var ( diff --git a/internal/assert/assert_test.go b/internal/assert/assert_test.go index a16395a..7e24c79 100644 --- a/internal/assert/assert_test.go +++ b/internal/assert/assert_test.go @@ -1,3 +1,17 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package assert_test import ( diff --git a/internal/collections/errors.go b/internal/collections/errors.go index 719079e..c800700 100644 --- a/internal/collections/errors.go +++ b/internal/collections/errors.go @@ -1,3 +1,17 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package collections import "errors" diff --git a/internal/collections/errors_test.go b/internal/collections/errors_test.go index 6f0988e..bf62127 100644 --- a/internal/collections/errors_test.go +++ b/internal/collections/errors_test.go @@ -1,3 +1,17 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package collections_test import ( diff --git a/internal/collections/set.go b/internal/collections/set.go index 2cae536..97f70bc 100644 --- a/internal/collections/set.go +++ b/internal/collections/set.go @@ -1,3 +1,17 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package collections type Set[T comparable] map[T]struct{} diff --git a/internal/collections/slice.go b/internal/collections/slice.go index 554715a..b4a9f3b 100644 --- a/internal/collections/slice.go +++ b/internal/collections/slice.go @@ -1,3 +1,17 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package collections func SliceContains[T comparable](haystack []T, needle T) bool { diff --git a/internal/logger/debug.go b/internal/logger/debug.go index c1d8bfd..a75463c 100644 --- a/internal/logger/debug.go +++ b/internal/logger/debug.go @@ -1,3 +1,17 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package logger import ( diff --git a/internal/multilinediff/multilinediff.go b/internal/multilinediff/multilinediff.go index a6e137f..dea8cc6 100644 --- a/internal/multilinediff/multilinediff.go +++ b/internal/multilinediff/multilinediff.go @@ -1,3 +1,17 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package multilinediff import ( diff --git a/internal/tempfile/golden.go b/internal/tempfile/golden.go index 0593ef1..b14b46b 100644 --- a/internal/tempfile/golden.go +++ b/internal/tempfile/golden.go @@ -1,3 +1,17 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package tempfile import ( diff --git a/internal/tempfile/path.go b/internal/tempfile/path.go index 63f82ad..777ff69 100644 --- a/internal/tempfile/path.go +++ b/internal/tempfile/path.go @@ -1,3 +1,17 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package tempfile import ( diff --git a/linebreak.go b/linebreak.go index a34c066..2012aab 100644 --- a/linebreak.go +++ b/linebreak.go @@ -1,3 +1,17 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package yamlfmt import "fmt" diff --git a/metadata.go b/metadata.go index deea91a..82abfc9 100644 --- a/metadata.go +++ b/metadata.go @@ -1,3 +1,17 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package yamlfmt import ( diff --git a/metadata_test.go b/metadata_test.go index 9b0c6f1..0c3fc7f 100644 --- a/metadata_test.go +++ b/metadata_test.go @@ -1,3 +1,17 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package yamlfmt_test import ( diff --git a/path_collector.go b/path_collector.go index b644650..09da92b 100644 --- a/path_collector.go +++ b/path_collector.go @@ -1,3 +1,17 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package yamlfmt import ( diff --git a/path_collector_test.go b/path_collector_test.go index 2963213..9d6d90f 100644 --- a/path_collector_test.go +++ b/path_collector_test.go @@ -1,3 +1,17 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package yamlfmt_test import ( diff --git a/testdata/content_analyzer/has_ignore/x.yaml b/testdata/content_analyzer/has_ignore/x.yaml index 4a76bd3..ab56c34 100644 --- a/testdata/content_analyzer/has_ignore/x.yaml +++ b/testdata/content_analyzer/has_ignore/x.yaml @@ -1,2 +1,16 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # !yamlfmt!:ignore a: 1 diff --git a/testdata/content_analyzer/has_ignore/y.yaml b/testdata/content_analyzer/has_ignore/y.yaml index a8926a5..e3fd523 100644 --- a/testdata/content_analyzer/has_ignore/y.yaml +++ b/testdata/content_analyzer/has_ignore/y.yaml @@ -1 +1,15 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + a: 1 diff --git a/testdata/content_analyzer/regex_ignore/x.yaml b/testdata/content_analyzer/regex_ignore/x.yaml index c0ae45b..9e09f23 100644 --- a/testdata/content_analyzer/regex_ignore/x.yaml +++ b/testdata/content_analyzer/regex_ignore/x.yaml @@ -1,2 +1,16 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # generated by: some tool a: 1 diff --git a/testdata/content_analyzer/regex_ignore/y.yaml b/testdata/content_analyzer/regex_ignore/y.yaml index a8926a5..e3fd523 100644 --- a/testdata/content_analyzer/regex_ignore/y.yaml +++ b/testdata/content_analyzer/regex_ignore/y.yaml @@ -1 +1,15 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + a: 1