From ef0ecb234f0b8ac14e7d08f3657249cf00ed5b82 Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Wed, 21 Feb 2024 13:44:29 +0100 Subject: [PATCH 1/3] ci: add license header check to pre-commit Related to packit/.github#9 Signed-off-by: Matej Focko --- .pre-commit-config.yaml | 10 ++++++++++ LICENSE_HEADER.txt | 2 ++ docs/conf.py | 3 +++ examples/basic_storage.py | 3 +++ examples/file_store.py | 3 +++ examples/generic_decorator.py | 3 +++ examples/request_example.py | 3 +++ 7 files changed, 27 insertions(+) create mode 100644 LICENSE_HEADER.txt diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 26cdd34..fd77d35 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -47,3 +47,13 @@ repos: args: - https://github.com/packit/requre.git stages: [manual, push] + - repo: https://github.com/Lucas-C/pre-commit-hooks + rev: v1.5.5 + hooks: + - id: insert-license + files: \.py$ + args: + - --license-filepath + - LICENSE_HEADER.txt + - --comment-style + - "#" diff --git a/LICENSE_HEADER.txt b/LICENSE_HEADER.txt new file mode 100644 index 0000000..8a99247 --- /dev/null +++ b/LICENSE_HEADER.txt @@ -0,0 +1,2 @@ +Copyright Contributors to the Packit project. +SPDX-License-Identifier: MIT diff --git a/docs/conf.py b/docs/conf.py index e8991c7..0f5c97f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,3 +1,6 @@ +# Copyright Contributors to the Packit project. +# SPDX-License-Identifier: MIT + # Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full diff --git a/examples/basic_storage.py b/examples/basic_storage.py index 37b2f5a..38266c0 100644 --- a/examples/basic_storage.py +++ b/examples/basic_storage.py @@ -1,3 +1,6 @@ +# Copyright Contributors to the Packit project. +# SPDX-License-Identifier: MIT + import tempfile from requre.cassette import Cassette diff --git a/examples/file_store.py b/examples/file_store.py index 3422eb2..a869039 100644 --- a/examples/file_store.py +++ b/examples/file_store.py @@ -1,3 +1,6 @@ +# Copyright Contributors to the Packit project. +# SPDX-License-Identifier: MIT + from requre.helpers.files import StoreFiles from requre.cassette import Cassette from tempfile import mkdtemp diff --git a/examples/generic_decorator.py b/examples/generic_decorator.py index d31e338..6533e30 100644 --- a/examples/generic_decorator.py +++ b/examples/generic_decorator.py @@ -1,3 +1,6 @@ +# Copyright Contributors to the Packit project. +# SPDX-License-Identifier: MIT + from requre.objects import ObjectStorage from requre.cassette import Cassette diff --git a/examples/request_example.py b/examples/request_example.py index bda382c..95f5417 100644 --- a/examples/request_example.py +++ b/examples/request_example.py @@ -1,3 +1,6 @@ +# Copyright Contributors to the Packit project. +# SPDX-License-Identifier: MIT + import requests import unittest from requre.online_replacing import record_requests_for_all_methods From a9eabd76a171938b8aab7ec0d93799e6cdda76b1 Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Wed, 21 Feb 2024 13:45:41 +0100 Subject: [PATCH 2/3] ci: add GH Actions schema validation Signed-off-by: Matej Focko --- .pre-commit-config.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fd77d35..fc6ecdb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -47,6 +47,11 @@ repos: args: - https://github.com/packit/requre.git stages: [manual, push] + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.28.0 + hooks: + - id: check-github-workflows + args: ["--verbose"] - repo: https://github.com/Lucas-C/pre-commit-hooks rev: v1.5.5 hooks: From 25e8f0472c117ce482c20a00a721525082739786 Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Wed, 21 Feb 2024 13:46:02 +0100 Subject: [PATCH 3/3] ci: remove PR template and add release notes check Signed-off-by: Matej Focko --- .github/PULL_REQUEST_TEMPLATE.md | 20 -------------------- .github/workflows/check-release-notes.yml | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 20 deletions(-) delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/check-release-notes.yml diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index b9b3cbc..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,20 +0,0 @@ -TODO: - -- [ ] ‹fill in› - - - - - -Fixes - -Related to - -Merge before/after - ---- - - diff --git a/.github/workflows/check-release-notes.yml b/.github/workflows/check-release-notes.yml new file mode 100644 index 0000000..2ab975b --- /dev/null +++ b/.github/workflows/check-release-notes.yml @@ -0,0 +1,15 @@ +name: Check release notes + +on: + pull_request: + types: + - opened + - edited + - synchronize + +jobs: + check_release_notes: + name: Notes are either written, or there are none + uses: packit/.github/.github/workflows/check-release-notes.yml@main + with: + description: ${{ github.event.pull_request.body }}