From 0e6aee3dfb238ed6051d6ea2606900728b03a0a0 Mon Sep 17 00:00:00 2001 From: Gabriel de Quadros Ligneul <8294320+gligneul@users.noreply.github.com> Date: Tue, 19 Sep 2023 13:59:28 -0300 Subject: [PATCH] refactor: remove conventional commits scope check --- .github/.check_scopes.lua | 40 ----------------------------------- .github/.scopes.txt | 8 ------- .github/workflows/commits.yml | 6 ------ CONTRIBUTING.md | 5 +---- 4 files changed, 1 insertion(+), 58 deletions(-) delete mode 100644 .github/.check_scopes.lua delete mode 100644 .github/.scopes.txt diff --git a/.github/.check_scopes.lua b/.github/.check_scopes.lua deleted file mode 100644 index df4648e5f..000000000 --- a/.github/.check_scopes.lua +++ /dev/null @@ -1,40 +0,0 @@ --- (c) Cartesi and individual authors (see AUTHORS) --- SPDX-License-Identifier: Apache-2.0 (see LICENSE) - -function extractScopesFromFile(filename) - local scopes = {} - local file = io.open(filename) - if not file then - error("Failed to open file: " .. filename) - end - for line in file:lines() do - local scope = line:match("%S+") - if scope then - scopes[scope] = true - end - end - file:close() - return scopes -end - -function extractScopeFromCommit(commitTitle) - return commitTitle:match("%a+%((.-)%)") -end - -local filename = ".github/.scopes.txt" -local scopes = extractScopesFromFile(filename) - --- Get commit titles using git log command -local handle = io.popen('git log --pretty=format:"%s" $(git merge-base HEAD origin/main)..HEAD') -local commits = handle:read("a") -assert(handle:close()) - --- Check if the scope matches for each commit -for line in commits:gmatch("[^\r\n]+") do - local commitScope = extractScopeFromCommit(line) - if commitScope and not scopes[commitScope] then - print("Invalid scope:", commitScope) - print("Commit:", line) - os.exit(1) - end -end diff --git a/.github/.scopes.txt b/.github/.scopes.txt deleted file mode 100644 index 05477953c..000000000 --- a/.github/.scopes.txt +++ /dev/null @@ -1,8 +0,0 @@ -advance-runner [For every change inside the offchain/advance-runner service] -host-runner [For every change inside the offchain/host-runner service] -claimer [For every change inside the offchain/authority-claime service] -dispatcher [For every change inside the offchain/dispatcher service] -graphql-server [For every change inside the offchain/graphql-server service] -indexer [For every change inside the offchain/indexer service] -inspect-server [For every change inside the offchain/inspect-server service] -state-server [For every change inside the offchain/state-server service] diff --git a/.github/workflows/commits.yml b/.github/workflows/commits.yml index 3f9cef805..c1730952f 100644 --- a/.github/workflows/commits.yml +++ b/.github/workflows/commits.yml @@ -17,9 +17,3 @@ jobs: uses: cocogitto/cocogitto-action@v3 with: check-latest-tag-only: true - - - name: Install Lua - uses: leafo/gh-actions-lua@v10 - - - name: Check scopes - run: lua .github/.check_scopes.lua diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0068c0267..d723e0a1a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -89,11 +89,8 @@ If there's a breaking change in this commit, add a `!` to the end of the type, e #### Scope -For information on the scopes of this repository, check the [scopes](.github/.scopes.txt) file for the full list of acceptable scopes. - The scope is optional, although highly recommended. -However, if you choose to add a scope, it **must** be one of the listed on the file. - +It should describe which part of the repository you are changing; for instance, the module name. #### Subject