chore(treewide): Reapply the license header

This commit is contained in:
Benedikt Peetz 2024-05-03 16:50:22 +02:00
parent 4fc61b2398
commit 3b5c35c0c4
15 changed files with 282 additions and 44 deletions

20
.envrc
View File

@ -1,3 +1,23 @@
# Copyright (C) 2024 - 2024:
# The Trinitrix Project <bpeetz@b-peetz.de, antifallobst@systemausfall.org>
# SPDX-License-Identifier: LGPL-3.0-or-later
#
# This file is part of the Trinitry crate for Trinitrix.
#
# Trinitry is free software: you can redistribute it and/or modify
# it under the terms of the Lesser GNU General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# and the Lesser GNU General Public License along with this program.
# If not, see <https://www.gnu.org/licenses/>.
use flake || use nix use flake || use nix
watch_file flake.nix watch_file flake.nix

20
.gitignore vendored
View File

@ -1,3 +1,23 @@
# Copyright (C) 2024 - 2024:
# The Trinitrix Project <bpeetz@b-peetz.de, antifallobst@systemausfall.org>
# SPDX-License-Identifier: LGPL-3.0-or-later
#
# This file is part of the Trinitry crate for Trinitrix.
#
# Trinitry is free software: you can redistribute it and/or modify
# it under the terms of the Lesser GNU General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# and the Lesser GNU General Public License along with this program.
# If not, see <https://www.gnu.org/licenses/>.
# build # build
/target /target
/result /result

View File

@ -1,3 +1,23 @@
# Copyright (C) 2024 - 2024:
# The Trinitrix Project <bpeetz@b-peetz.de, antifallobst@systemausfall.org>
# SPDX-License-Identifier: LGPL-3.0-or-later
#
# This file is part of the Trinitry crate for Trinitrix.
#
# Trinitry is free software: you can redistribute it and/or modify
# it under the terms of the Lesser GNU General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# and the Lesser GNU General Public License along with this program.
# If not, see <https://www.gnu.org/licenses/>.
--- ---
# Regexes which if matched by a file path will always be excluded from # Regexes which if matched by a file path will always be excluded from
# getting a license header # getting a license header

View File

@ -1,3 +1,23 @@
# Copyright (C) 2024 - 2024:
# The Trinitrix Project <bpeetz@b-peetz.de, antifallobst@systemausfall.org>
# SPDX-License-Identifier: LGPL-3.0-or-later
#
# This file is part of the Trinitry crate for Trinitrix.
#
# Trinitry is free software: you can redistribute it and/or modify
# it under the terms of the Lesser GNU General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# and the Lesser GNU General Public License along with this program.
# If not, see <https://www.gnu.org/licenses/>.
[package] [package]
name = "trinitry" name = "trinitry"
description = "A very simple programming language, used to map functions to commands" description = "A very simple programming language, used to map functions to commands"
@ -8,8 +28,8 @@ edition = "2021"
[dependencies] [dependencies]
pest = "2.7.5" pest = "2.7.5"
pest_derive = {version = "2.7.5", features = ["grammar-extras"]} pest_derive = { version = "2.7.5", features = ["grammar-extras"] }
# The header imports katex, a js latex parser, into the doc comments # The header imports katex, a js latex parser, into the doc comments
[package.metadata.docs.rs] [package.metadata.docs.rs]
rustdoc-args = [ "--html-in-header", "./docs/docs-header.html" ] rustdoc-args = ["--html-in-header", "./docs/docs-header.html"]

View File

@ -1,3 +1,25 @@
<!--
Copyright (C) 2024 - 2024:
The Trinitrix Project <bpeetz@b-peetz.de, antifallobst@systemausfall.org>
SPDX-License-Identifier: LGPL-3.0-or-later
This file is part of the Trinitry crate for Trinitrix.
Trinitry is free software: you can redistribute it and/or modify
it under the terms of the Lesser GNU General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
and the Lesser GNU General Public License along with this program.
If not, see <https://www.gnu.org/licenses/>.
-->
# Trinitry # Trinitry
> A very simple programming language, used to map functions to commands > A very simple programming language, used to map functions to commands

View File

@ -1,3 +1,23 @@
# Copyright (C) 2024 - 2024:
# The Trinitrix Project <bpeetz@b-peetz.de, antifallobst@systemausfall.org>
# SPDX-License-Identifier: LGPL-3.0-or-later
#
# This file is part of the Trinitry crate for Trinitrix.
#
# Trinitry is free software: you can redistribute it and/or modify
# it under the terms of the Lesser GNU General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# and the Lesser GNU General Public License along with this program.
# If not, see <https://www.gnu.org/licenses/>.
tag_prefix = "v" tag_prefix = "v"
branch_whitelist = ["main", "prime"] branch_whitelist = ["main", "prime"]
ignore_merge_commits = false ignore_merge_commits = false

View File

@ -1,5 +1,7 @@
<!-- <!--
Copyright (C) 2023 The Trinitrix Project <soispha@vhack.eu, antifallobst@systemausfall.org> Copyright (C) 2024 - 2024:
The Trinitrix Project <bpeetz@b-peetz.de, antifallobst@systemausfall.org>
SPDX-License-Identifier: LGPL-3.0-or-later
This file is part of the Trinitry crate for Trinitrix. This file is part of the Trinitry crate for Trinitrix.
@ -18,7 +20,6 @@ and the Lesser GNU General Public License along with this program.
If not, see <https://www.gnu.org/licenses/>. If not, see <https://www.gnu.org/licenses/>.
--> -->
<!doctype html> <!doctype html>
<!-- KaTeX requires the use of the HTML5 doctype. Without it, KaTeX may not render properly --> <!-- KaTeX requires the use of the HTML5 doctype. Without it, KaTeX may not render properly -->
<html> <html>

View File

@ -1,3 +1,22 @@
# Copyright (C) 2024 - 2024:
# The Trinitrix Project <bpeetz@b-peetz.de, antifallobst@systemausfall.org>
# SPDX-License-Identifier: LGPL-3.0-or-later
#
# This file is part of the Trinitry crate for Trinitrix.
#
# Trinitry is free software: you can redistribute it and/or modify
# it under the terms of the Lesser GNU General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# and the Lesser GNU General Public License along with this program.
# If not, see <https://www.gnu.org/licenses/>.
{ {
description = "A very simple programming language, used to map functions to commands"; description = "A very simple programming language, used to map functions to commands";
@ -88,6 +107,8 @@
packages = with pkgs; [ packages = with pkgs; [
cocogitto cocogitto
yq
rust_default rust_default
cargo-edit cargo-edit

View File

@ -1,4 +1,23 @@
#! /usr/bin/env sh #! /usr/bin/env sh
# Copyright (C) 2024 - 2024:
# The Trinitrix Project <bpeetz@b-peetz.de, antifallobst@systemausfall.org>
# SPDX-License-Identifier: LGPL-3.0-or-later
#
# This file is part of the Trinitry crate for Trinitrix.
#
# Trinitry is free software: you can redistribute it and/or modify
# it under the terms of the Lesser GNU General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# and the Lesser GNU General Public License along with this program.
# If not, see <https://www.gnu.org/licenses/>.
# NOTE: This is the line length of the .licensure.yml header template **plus** the extra # NOTE: This is the line length of the .licensure.yml header template **plus** the extra
# line after the template comment. # line after the template comment.

View File

@ -1,5 +1,7 @@
#!/usr/bin/env sh #! /usr/bin/env sh
# Copyright (C) 2023 The Trinitrix Project <soispha@vhack.eu, antifallobst@systemausfall.org> # Copyright (C) 2024 - 2024:
# The Trinitrix Project <bpeetz@b-peetz.de, antifallobst@systemausfall.org>
# SPDX-License-Identifier: LGPL-3.0-or-later
# #
# This file is part of the Trinitry crate for Trinitrix. # This file is part of the Trinitry crate for Trinitrix.
# #
@ -17,25 +19,24 @@
# and the Lesser GNU General Public License along with this program. # and the Lesser GNU General Public License along with this program.
# If not, see <https://www.gnu.org/licenses/>. # If not, see <https://www.gnu.org/licenses/>.
# This script generates ./src/tests.rs # This script generates ./src/tests.rs
# Library {{{ # Library {{{
mktmp() { mktmp() {
ensure_tmp_dir ensure_tmp_dir
mktemp -p "$LIB_TEMP_DIR_FOR_SCRIPT" mktemp -p "$LIB_TEMP_DIR_FOR_SCRIPT"
} }
ensure_tmp_dir() { ensure_tmp_dir() {
if ! [ -d "$LIB_TEMP_DIR_FOR_SCRIPT" ]; then if ! [ -d "$LIB_TEMP_DIR_FOR_SCRIPT" ]; then
LIB_TEMP_DIR_FOR_SCRIPT="$(mktemp -d)" LIB_TEMP_DIR_FOR_SCRIPT="$(mktemp -d)"
export LIB_TEMP_DIR_FOR_SCRIPT export LIB_TEMP_DIR_FOR_SCRIPT
fi fi
} }
remove_tmp_dir() { remove_tmp_dir() {
# The test is here because some scripts still delete this on their own # The test is here because some scripts still delete this on their own
if [ -d "$LIB_TEMP_DIR_FOR_SCRIPT" ]; then if [ -d "$LIB_TEMP_DIR_FOR_SCRIPT" ]; then
rm -r "$LIB_TEMP_DIR_FOR_SCRIPT" rm -r "$LIB_TEMP_DIR_FOR_SCRIPT"
fi fi
} }
trap remove_tmp_dir EXIT trap remove_tmp_dir EXIT
@ -45,14 +46,14 @@ ensure_tmp_dir # ensure that the variable has been set, even in subshells
tmp="$(mktmp)" tmp="$(mktmp)"
curl https://raw.githubusercontent.com/minimaxir/big-list-of-naughty-strings/master/blns.txt | curl https://raw.githubusercontent.com/minimaxir/big-list-of-naughty-strings/master/blns.txt |
awk '!/^#/' | awk '!/^#/' |
awk '!/^[\s\t]*$/' | awk '!/^[\s\t]*$/' |
awk -v s="'" '!/.*s.*/' | awk -v s="'" '!/.*s.*/' |
# This entry contains duplicated spaces, just ignore it # This entry contains duplicated spaces, just ignore it
awk '!/Power/' | awk '!/Power/' |
iconv -c -f utf-8 -t ascii \ iconv -c -f utf-8 -t ascii \
>"$tmp" >"$tmp"
counter=0 counter=0
@ -67,10 +68,10 @@ mod test {
EOF EOF
while read -r name; do while read -r name; do
tmp2="$(mktmp)" tmp2="$(mktmp)"
printf "%s" "$name" >"$tmp2" printf "%s" "$name" >"$tmp2"
if rg '^[A-Za-z0-9_.-]+$' "$tmp2" -q; then if rg '^[A-Za-z0-9_.-]+$' "$tmp2" -q; then
cat <<EOF cat <<EOF
#[test] #[test]
fn parse_$counter() { fn parse_$counter() {
let p = Trinitry::new(r##"$name"##).unwrap_or_else(|e| { let p = Trinitry::new(r##"$name"##).unwrap_or_else(|e| {
@ -79,8 +80,8 @@ while read -r name; do
assert_eq!(r##"$name"##, &p.to_string()); assert_eq!(r##"$name"##, &p.to_string());
} }
EOF EOF
elif rg '^[A-Za-z0-9_.-]+ [A-Za-z0-9_.(){}<>?!+^@&*~|=,/\\ -]*$' "$tmp2" -q; then elif rg '^[A-Za-z0-9_.-]+ [A-Za-z0-9_.(){}<>?!+^@&*~|=,/\\ -]*$' "$tmp2" -q; then
cat <<EOF cat <<EOF
#[test] #[test]
fn parse_$counter() { fn parse_$counter() {
let p = Trinitry::new(r##"$name"##).unwrap_or_else(|e| { let p = Trinitry::new(r##"$name"##).unwrap_or_else(|e| {
@ -89,16 +90,16 @@ EOF
assert_eq!(r##"$name"##, &p.to_string()); assert_eq!(r##"$name"##, &p.to_string());
} }
EOF EOF
else else
cat <<EOF cat <<EOF
#[test] #[test]
fn parse_$counter() { fn parse_$counter() {
let p = Trinitry::new(r##"$name"##); let p = Trinitry::new(r##"$name"##);
assert!(p.is_err()); assert!(p.is_err());
} }
EOF EOF
fi fi
counter=$((counter + 1)) counter=$((counter + 1))
done <"$tmp" done <"$tmp"
cat <<EOF cat <<EOF

View File

@ -1,5 +1,7 @@
/* /*
* Copyright (C) 2023 The Trinitrix Project <soispha@vhack.eu, antifallobst@systemausfall.org> * Copyright (C) 2024 - 2024:
* The Trinitrix Project <bpeetz@b-peetz.de, antifallobst@systemausfall.org>
* SPDX-License-Identifier: LGPL-3.0-or-later
* *
* This file is part of the Trinitry crate for Trinitrix. * This file is part of the Trinitry crate for Trinitrix.
* *
@ -18,7 +20,6 @@
* If not, see <https://www.gnu.org/licenses/>. * If not, see <https://www.gnu.org/licenses/>.
*/ */
//! This crate is a parser for the 'Trinitry' (not 'Trinity') language, used to map all sort of //! This crate is a parser for the 'Trinitry' (not 'Trinity') language, used to map all sort of
//! Functions to a memorable command. //! Functions to a memorable command.
//! //!

View File

@ -1,3 +1,25 @@
/*
* Copyright (C) 2024 - 2024:
* The Trinitrix Project <bpeetz@b-peetz.de, antifallobst@systemausfall.org>
* SPDX-License-Identifier: LGPL-3.0-or-later
*
* This file is part of the Trinitry crate for Trinitrix.
*
* Trinitry is free software: you can redistribute it and/or modify
* it under the terms of the Lesser GNU General Public License as
* published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* and the Lesser GNU General Public License along with this program.
* If not, see <https://www.gnu.org/licenses/>.
*/
// DO NOT EDIT // DO NOT EDIT
// This file is automatically generated by the 'update.sh' file, with data from: // This file is automatically generated by the 'update.sh' file, with data from:
// https://raw.githubusercontent.com/minimaxir/big-list-of-naughty-strings/master/blns.txt // https://raw.githubusercontent.com/minimaxir/big-list-of-naughty-strings/master/blns.txt
@ -345,7 +367,10 @@ mod test {
let p = Trinitry::new(r##"999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999"##).unwrap_or_else(|e| { let p = Trinitry::new(r##"999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999"##).unwrap_or_else(|e| {
panic!("{}", e); panic!("{}", e);
}); });
assert_eq!(r##"999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999"##, &p.to_string()); assert_eq!(
r##"999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999"##,
&p.to_string()
);
} }
#[test] #[test]
fn parse_56() { fn parse_56() {
@ -433,7 +458,10 @@ mod test {
let p = Trinitry::new(r##"123456789012345678901234567890123456789"##).unwrap_or_else(|e| { let p = Trinitry::new(r##"123456789012345678901234567890123456789"##).unwrap_or_else(|e| {
panic!("{}", e); panic!("{}", e);
}); });
assert_eq!(r##"123456789012345678901234567890123456789"##, &p.to_string()); assert_eq!(
r##"123456789012345678901234567890123456789"##,
&p.to_string()
);
} }
#[test] #[test]
fn parse_70() { fn parse_70() {
@ -1029,17 +1057,23 @@ mod test {
} }
#[test] #[test]
fn parse_184() { fn parse_184() {
let p = Trinitry::new(r##"<IMG SRC=&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#58;&#97;&#108;&#101;&#114;&#116;&#40;&#39;&#50;&#49;&#49;&#39;&#41;>"##); let p = Trinitry::new(
r##"<IMG SRC=&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#58;&#97;&#108;&#101;&#114;&#116;&#40;&#39;&#50;&#49;&#49;&#39;&#41;>"##,
);
assert!(p.is_err()); assert!(p.is_err());
} }
#[test] #[test]
fn parse_185() { fn parse_185() {
let p = Trinitry::new(r##"<IMG SRC=&#0000106&#0000097&#0000118&#0000097&#0000115&#0000099&#0000114&#0000105&#0000112&#0000116&#0000058&#0000097&#0000108&#0000101&#0000114&#0000116&#0000040&#0000039&#0000050&#0000049&#0000050&#0000039&#0000041>"##); let p = Trinitry::new(
r##"<IMG SRC=&#0000106&#0000097&#0000118&#0000097&#0000115&#0000099&#0000114&#0000105&#0000112&#0000116&#0000058&#0000097&#0000108&#0000101&#0000114&#0000116&#0000040&#0000039&#0000050&#0000049&#0000050&#0000039&#0000041>"##,
);
assert!(p.is_err()); assert!(p.is_err());
} }
#[test] #[test]
fn parse_186() { fn parse_186() {
let p = Trinitry::new(r##"<IMG SRC=&#x6A&#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A&#x61&#x6C&#x65&#x72&#x74&#x28&#x27&#x32&#x31&#x33&#x27&#x29>"##); let p = Trinitry::new(
r##"<IMG SRC=&#x6A&#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A&#x61&#x6C&#x65&#x72&#x74&#x28&#x27&#x32&#x31&#x33&#x27&#x29>"##,
);
assert!(p.is_err()); assert!(p.is_err());
} }
#[test] #[test]

View File

@ -1,4 +1,6 @@
// Copyright (C) 2023 The Trinitrix Project <soispha@vhack.eu, antifallobst@systemausfall.org> // Copyright (C) 2024 - 2024:
// The Trinitrix Project <bpeetz@b-peetz.de, antifallobst@systemausfall.org>
// SPDX-License-Identifier: LGPL-3.0-or-later
// //
// This file is part of the Trinitry crate for Trinitrix. // This file is part of the Trinitry crate for Trinitrix.
// //
@ -16,7 +18,6 @@
// and the Lesser GNU General Public License along with this program. // and the Lesser GNU General Public License along with this program.
// If not, see <https://www.gnu.org/licenses/>. // If not, see <https://www.gnu.org/licenses/>.
chars = { ASCII_ALPHANUMERIC | "_" | "-" | "." } chars = { ASCII_ALPHANUMERIC | "_" | "-" | "." }
// TODO(@soispha): Are these all the valid characters? <2023-11-01> // TODO(@soispha): Are these all the valid characters? <2023-11-01>

View File

@ -1,3 +1,22 @@
# Copyright (C) 2024 - 2024:
# The Trinitrix Project <bpeetz@b-peetz.de, antifallobst@systemausfall.org>
# SPDX-License-Identifier: LGPL-3.0-or-later
#
# This file is part of the Trinitry crate for Trinitrix.
#
# Trinitry is free software: you can redistribute it and/or modify
# it under the terms of the Lesser GNU General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# and the Lesser GNU General Public License along with this program.
# If not, see <https://www.gnu.org/licenses/>.
{ {
treefmt-nix, treefmt-nix,
pkgs, pkgs,

View File

@ -1,4 +1,23 @@
#!/usr/bin/env sh #! /usr/bin/env sh
# Copyright (C) 2024 - 2024:
# The Trinitrix Project <bpeetz@b-peetz.de, antifallobst@systemausfall.org>
# SPDX-License-Identifier: LGPL-3.0-or-later
#
# This file is part of the Trinitry crate for Trinitrix.
#
# Trinitry is free software: you can redistribute it and/or modify
# it under the terms of the Lesser GNU General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# and the Lesser GNU General Public License along with this program.
# If not, see <https://www.gnu.org/licenses/>.
nix flake update nix flake update
cargo update cargo update