From c30ebc30d30713df4776e4a0e5e8d0e772ca5652 Mon Sep 17 00:00:00 2001 From: Mike Fiedler Date: Wed, 14 May 2025 13:33:54 -0400 Subject: [PATCH 1/2] chore: update license check to allow spdx header Signed-off-by: Mike Fiedler --- bin/licenses | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/licenses b/bin/licenses index c73be8a3a8d1..4ba0d11ba921 100755 --- a/bin/licenses +++ b/bin/licenses @@ -9,7 +9,9 @@ for fn in $(find . -type f \( \ -name "*.scss" -o \ ! -name "*.min.js" \ -name "*.js" \) \ + ! -path "./.cache*" \ ! -path "./.state*" \ + ! -path "./.venv*" \ ! -path "./docs*" \ ! -path "./htmlcov*" \ ! -path "./node_modules*" \ @@ -18,7 +20,7 @@ for fn in $(find . -type f \( \ ! -path "./warehouse/static/html*" \ ! -path "./warehouse/static/js/vendor*"); do # Check for license in first 5 lines (allows for shebang, encoding and handles comment character in various languages) - if [[ ! "$(head -5 $fn | grep "^ *\(#\|\*\|\/\/\) .* License\(d*\)")" ]]; then + if [[ ! "$(head -5 $fn | grep "^ *\(#\|\*\|\/\/\|\/\*\|{#\).*License")" ]]; then echo $fn is missing a license EXIT_CODE=1 fi From 0db18296aeb62b510e808ca1ab6e678a09abb378 Mon Sep 17 00:00:00 2001 From: Mike Fiedler Date: Wed, 14 May 2025 13:38:20 -0400 Subject: [PATCH 2/2] docs: update license code Signed-off-by: Mike Fiedler --- docs/dev/development/submitting-patches.rst | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/docs/dev/development/submitting-patches.rst b/docs/dev/development/submitting-patches.rst index 9e5c022dc170..32e2d3b2c1af 100644 --- a/docs/dev/development/submitting-patches.rst +++ b/docs/dev/development/submitting-patches.rst @@ -34,17 +34,7 @@ Every code file must start with the boilerplate licensing notice: .. code-block:: python - # 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. + # SPDX-License-Identifier: Apache-2.0 You can view :doc:`patterns` to see more patterns that should be used within Warehouse.