diff --git a/.github/.gitignore b/.github/.gitignore index 44d7f86..c3421a1 100644 --- a/.github/.gitignore +++ b/.github/.gitignore @@ -1 +1,4 @@ +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT + .goassets diff --git a/.github/fetch-scripts.sh b/.github/fetch-scripts.sh index d7e848b..f333841 100755 --- a/.github/fetch-scripts.sh +++ b/.github/fetch-scripts.sh @@ -8,6 +8,8 @@ # If you want to update the shared CI config, send a PR to # https://github.com/pion/.goassets instead of this repository. # +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT set -eu diff --git a/.github/install-hooks.sh b/.github/install-hooks.sh index 57b7798..8aa34be 100755 --- a/.github/install-hooks.sh +++ b/.github/install-hooks.sh @@ -8,6 +8,8 @@ # If you want to update the shared CI config, send a PR to # https://github.com/pion/.goassets instead of this repository. # +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT SCRIPT_PATH="$(realpath "$(dirname "$0")")" diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index bb44904..ea9b825 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -8,6 +8,8 @@ # If you want to update the shared CI config, send a PR to # https://github.com/pion/.goassets instead of this repository. # +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT name: CodeQL diff --git a/.github/workflows/generate-authors.yml b/.github/workflows/generate-authors.yml index 9fc78bc..ec7446c 100644 --- a/.github/workflows/generate-authors.yml +++ b/.github/workflows/generate-authors.yml @@ -8,6 +8,8 @@ # If you want to update the shared CI config, send a PR to # https://github.com/pion/.goassets instead of this repository. # +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT name: Generate Authors diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index e72c716..5dd3a99 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -8,6 +8,8 @@ # If you want to update the shared CI config, send a PR to # https://github.com/pion/.goassets instead of this repository. # +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT name: Lint on: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d07dfdf..01227e2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,6 +8,8 @@ # If you want to update the shared CI config, send a PR to # https://github.com/pion/.goassets instead of this repository. # +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT name: Release on: diff --git a/.github/workflows/renovate-go-sum-fix.yaml b/.github/workflows/renovate-go-sum-fix.yaml index 5a9af36..b7bb1b4 100644 --- a/.github/workflows/renovate-go-sum-fix.yaml +++ b/.github/workflows/renovate-go-sum-fix.yaml @@ -8,6 +8,8 @@ # If you want to update the shared CI config, send a PR to # https://github.com/pion/.goassets instead of this repository. # +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT name: Fix go.sum on: diff --git a/.github/workflows/reuse.yml b/.github/workflows/reuse.yml new file mode 100644 index 0000000..8633a12 --- /dev/null +++ b/.github/workflows/reuse.yml @@ -0,0 +1,22 @@ +# +# DO NOT EDIT THIS FILE +# +# It is automatically copied from https://github.com/pion/.goassets repository. +# If this repository should have package specific CI config, +# remove the repository name from .goassets/.github/workflows/assets-sync.yml. +# +# If you want to update the shared CI config, send a PR to +# https://github.com/pion/.goassets instead of this repository. +# +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT + +name: REUSE Compliance Check + +on: + push: + pull_request: + +jobs: + lint: + uses: pion/.goassets/.github/workflows/reuse.reusable.yml@master diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7fcb1f5..31aada4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -8,6 +8,8 @@ # If you want to update the shared CI config, send a PR to # https://github.com/pion/.goassets instead of this repository. # +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT name: Test on: diff --git a/.github/workflows/tidy-check.yaml b/.github/workflows/tidy-check.yaml index b94cc19..4d346d4 100644 --- a/.github/workflows/tidy-check.yaml +++ b/.github/workflows/tidy-check.yaml @@ -8,6 +8,8 @@ # If you want to update the shared CI config, send a PR to # https://github.com/pion/.goassets instead of this repository. # +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT name: Go mod tidy on: diff --git a/.gitignore b/.gitignore index f977e74..6e2f206 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT + ### JetBrains IDE ### ##################### .idea/ diff --git a/.golangci.yml b/.golangci.yml index 48696f1..826254a 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT + linters-settings: govet: check-shadowing: true @@ -10,7 +13,15 @@ linters-settings: modules: - github.com/pkg/errors: recommendations: - - errors + - errors + forbidigo: + forbid: + - Fatal(f|ln)?$ + - ^fmt.Print(f|ln)?$ + - ^log.Print(f|ln)?$ + - ^os.Exit$ + - ^panic$ + - ^print(ln)?$ linters: enable: @@ -29,6 +40,7 @@ linters: - errorlint # errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13. - exhaustive # check exhaustiveness of enum switch statements - exportloopref # checks for pointers to enclosing loop variables + - forbidigo # Forbids identifiers - forcetypeassert # finds forced type assertions - gci # Gci control golang package import order and make it always deterministic. - gochecknoglobals # Checks that no globals are present in Go code @@ -73,7 +85,6 @@ linters: - containedctx # containedctx is a linter that detects struct contained context.Context field - cyclop # checks function and package cyclomatic complexity - exhaustivestruct # Checks if all struct's fields are initialized - - forbidigo # Forbids identifiers - funlen # Tool for detection of long functions - gocyclo # Computes and checks the cyclomatic complexity of functions - godot # Check if comments end in a period @@ -105,12 +116,23 @@ issues: - path: _test\.go linters: - gocognit + - forbidigo # Allow complex main function in examples - path: examples text: "of func `main` is high" linters: - gocognit + + # Allow forbidden identifiers in examples + - path: examples + linters: + - forbidigo + + # Allow forbidden identifiers in CLI commands + - path: cmd + linters: + - forbidigo run: skip-dirs-use-default: false diff --git a/.goreleaser.yml b/.goreleaser.yml index 2caa5fb..30093e9 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,2 +1,5 @@ +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT + builds: - skip: true diff --git a/.reuse/dep5 b/.reuse/dep5 new file mode 100644 index 0000000..ccc710a --- /dev/null +++ b/.reuse/dep5 @@ -0,0 +1,7 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: Pion +Source: https://github.com/pion/ + +Files: README.md AUTHORS.txt renovate.json +Copyright: 2023 The Pion community +License: MIT diff --git a/codecov.yml b/codecov.yml index 085200a..263e4d4 100644 --- a/codecov.yml +++ b/codecov.yml @@ -3,6 +3,8 @@ # # It is automatically copied from https://github.com/pion/.goassets repository. # +# SPDX-FileCopyrightText: 2023 The Pion community +# SPDX-License-Identifier: MIT coverage: status: