From 536d7c3113c8b72cb33189460d586f776d13a3fb Mon Sep 17 00:00:00 2001 From: Pion <59523206+pionbot@users.noreply.github.com> Date: Tue, 18 Apr 2023 10:38:46 +0000 Subject: [PATCH] Update CI configs to v0.10.7 Update lint scripts and CI configs. --- .github/.gitignore | 3 +++ .github/fetch-scripts.sh | 2 ++ .github/install-hooks.sh | 2 ++ .github/workflows/codeql-analysis.yml | 2 ++ .github/workflows/generate-authors.yml | 2 ++ .github/workflows/lint.yaml | 2 ++ .github/workflows/release.yml | 2 ++ .github/workflows/renovate-go-sum-fix.yaml | 2 ++ .github/workflows/reuse.yml | 22 ++++++++++++++++++ .github/workflows/test.yaml | 2 ++ .github/workflows/tidy-check.yaml | 2 ++ .gitignore | 3 +++ .golangci.yml | 26 ++++++++++++++++++++-- .goreleaser.yml | 3 +++ .reuse/dep5 | 7 ++++++ codecov.yml | 2 ++ 16 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/reuse.yml create mode 100644 .reuse/dep5 diff --git a/.github/.gitignore b/.github/.gitignore index 44d7f86a..c3421a1a 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 d7e848b3..f333841e 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 57b77988..8aa34be9 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 bb449043..ea9b825e 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 9fc78bcd..ec7446c8 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 e72c7166..5dd3a993 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 d07dfdf3..01227e2a 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 5a9af364..b7bb1b4f 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 00000000..8633a12a --- /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 7fcb1f51..31aada4a 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 b94cc19b..4d346d4f 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 f977e748..6e2f206a 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 48696f16..826254a0 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 2caa5fbd..30093e9d 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 00000000..ccc710a5 --- /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 085200a4..263e4d45 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: