diff --git a/.github/workflows/trustfile.yml b/.github/workflows/trustfile.yml index 5b15cd65..41238386 100644 --- a/.github/workflows/trustfile.yml +++ b/.github/workflows/trustfile.yml @@ -87,13 +87,14 @@ jobs: uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - name: Check SPDX license compliance run: | - # All source files must use MPL-2.0 + # Estate licence policy: code is MPL-2.0, docs are CC-BY-SA-4.0. + # Flag only files whose SPDX header is neither of the two. WRONG_LICENSE=$(grep -rl "SPDX-License-Identifier:" src/ ffi/ bindings/ 2>/dev/null | \ - xargs grep -L "MPL-2.0" 2>/dev/null | wc -l) + xargs grep -LE "MPL-2.0|CC-BY-SA-4.0" 2>/dev/null | wc -l) if [ "$WRONG_LICENSE" -gt 0 ]; then - echo "ERROR: $WRONG_LICENSE files have incorrect SPDX license headers" + echo "ERROR: $WRONG_LICENSE files have an SPDX header that is neither MPL-2.0 (code) nor CC-BY-SA-4.0 (docs)" grep -rl "SPDX-License-Identifier:" src/ ffi/ bindings/ 2>/dev/null | \ - xargs grep -L "MPL-2.0" 2>/dev/null | head -20 + xargs grep -LE "MPL-2.0|CC-BY-SA-4.0" 2>/dev/null | head -20 exit 1 fi echo "License compliance: PASS" diff --git a/bindings/d/source/proven/safe_color.d b/bindings/d/source/proven/safe_color.d index 4ad3cb67..f2f572bd 100644 --- a/bindings/d/source/proven/safe_color.d +++ b/bindings/d/source/proven/safe_color.d @@ -46,12 +46,12 @@ struct ColorResult string error; bool ok; - static ColorResult success(RGB color) + static ColorResult success(RGB color) nothrow { return ColorResult(color, "", true); } - static ColorResult failure(string error) + static ColorResult failure(string error) nothrow { return ColorResult(RGB.init, error, false); } diff --git a/bindings/d/source/proven/safe_currency.d b/bindings/d/source/proven/safe_currency.d index d7ae709e..1dba1cad 100644 --- a/bindings/d/source/proven/safe_currency.d +++ b/bindings/d/source/proven/safe_currency.d @@ -24,12 +24,12 @@ struct CurrencyResult string error; bool ok; - static CurrencyResult success(long amount, ubyte[3] code, ubyte decimals) + static CurrencyResult success(long amount, ubyte[3] code, ubyte decimals) nothrow { return CurrencyResult(amount, code, decimals, "", true); } - static CurrencyResult failure(string error) + static CurrencyResult failure(string error) nothrow { return CurrencyResult(0, [0, 0, 0], 0, error, false); } diff --git a/bindings/d/source/proven/safe_datetime.d b/bindings/d/source/proven/safe_datetime.d index 18c8763b..25855483 100644 --- a/bindings/d/source/proven/safe_datetime.d +++ b/bindings/d/source/proven/safe_datetime.d @@ -52,12 +52,12 @@ struct DateTimeResult string error; bool ok; - static DateTimeResult success(DateTime dt) + static DateTimeResult success(DateTime dt) nothrow { return DateTimeResult(dt, "", true); } - static DateTimeResult failure(string error) + static DateTimeResult failure(string error) nothrow { return DateTimeResult(DateTime.init, error, false); } diff --git a/bindings/d/source/proven/safe_phone.d b/bindings/d/source/proven/safe_phone.d index f80bd40a..ef9b383c 100644 --- a/bindings/d/source/proven/safe_phone.d +++ b/bindings/d/source/proven/safe_phone.d @@ -30,12 +30,12 @@ struct PhoneResult string error; bool ok; - static PhoneResult success(PhoneNumber phone) + static PhoneResult success(PhoneNumber phone) nothrow { return PhoneResult(phone, "", true); } - static PhoneResult failure(string error) + static PhoneResult failure(string error) nothrow { return PhoneResult(PhoneNumber.init, error, false); } diff --git a/bindings/d/source/proven/safe_url.d b/bindings/d/source/proven/safe_url.d index 65c0a393..329ece61 100644 --- a/bindings/d/source/proven/safe_url.d +++ b/bindings/d/source/proven/safe_url.d @@ -39,12 +39,12 @@ struct UrlResult string error; bool ok; - static UrlResult success(ParsedUrl url) + static UrlResult success(ParsedUrl url) nothrow { return UrlResult(url, "", true); } - static UrlResult failure(string error) + static UrlResult failure(string error) nothrow { return UrlResult(ParsedUrl.init, error, false); }