Browse Source

docs, fixups

Signed-off-by: crueter <crueter@eden-emu.dev>
pull/2780/head
crueter 5 months ago
parent
commit
e2b5397500
No known key found for this signature in database GPG Key ID: 425ACD2D4830EBC6
  1. 66
      .ci/license-header.sh
  2. 8
      docs/Development.md

66
.ci/license-header.sh

@ -3,15 +3,40 @@
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
# argparse
# specify full path if dupes may exist
EXCLUDE_FILES="CPM.cmake CPMUtil.cmake GetSCMRev.cmake sse2neon.h tools/cpm"
# license header constants, please change when needed :))))
YEAR=2025
HOLDER="Eden Emulator Project"
LICENSE="GPL-3.0-or-later"
usage() {
cat << EOF
$0: Check license headers compared to this branch's merge base with master.
Usage: $0 [uc]
-u, --update Fix license headers, if applicable
-c, --commit Commit changes to Git (requires --update)
Compares the current HEAD to the master branch to check for license
header discrepancies. Each file changed in a branch MUST have a
license header, and this script attempts to enforce that.
Options:
-u, --update Fix license headers, if applicable;
if the license header exists but has the incorrect
year or is otherwise malformed, it will be fixed.
-c, --commit Commit changes to Git (requires --update)
Copyright $YEAR $HOLDER
Licensed under $LICENSE
The following files/directories are marked as external
and thus will not have license headers asserted:
EOF
for file in $EXCLUDE_FILES; do
echo "- $file"
done
exit 0
}
while true; do
@ -27,15 +52,6 @@ while true; do
shift
done
# specify full path if dupes may exist
EXCLUDE_FILES="CPM.cmake CPMUtil.cmake GetSCMRev.cmake sse2neon.h"
EXCLUDE_FILES=$(echo "$EXCLUDE_FILES" | sed 's/ /|/g')
# license header constants, please change when needed :))))
YEAR=2025
HOLDER="Eden Emulator Project"
LICENSE="GPL-3.0-or-later"
# human-readable header string
header() {
header_line1 "$1"
@ -83,17 +99,31 @@ FILES=$(git diff --name-only "$BASE")
for file in $FILES; do
[ -f "$file" ] || continue
case $(basename -- "$file") in
"$EXCLUDE_FILES")
# skip files that are third party (crueter's CMake modules, sse2neon, etc)
continue
;;
# skip files that are third party (crueter's CMake modules, sse2neon, etc)
for pattern in $EXCLUDE_FILES; do
case "$file" in
*"$pattern"*)
excluded=true
continue
;;
*)
excluded=false
;;
esac
done
[ "$excluded" = "true" ] && continue
case "$file" in
*.cmake|*.sh|CMakeLists.txt)
begin="#"
;;
*.kt*|*.cpp|*.h)
begin="//"
;;
*)
continue
;;
esac
check_header "$begin" "$file"

8
docs/Development.md

@ -6,19 +6,21 @@ All commits must have proper license header accreditation.
You can easily add all necessary license headers by running:
```sh
git fetch origin master:master
FIX=true COMMIT=true .ci/license-header.sh
.ci/license-header.sh -u -c
git push
```
Alternatively, you may omit `COMMIT=true` and do an amend commit:
Alternatively, you may omit `-c` and do an amend commit:
```sh
git fetch origin master:master
FIX=true .ci/license-header.sh
.ci/license-header.sh
git commit --amend -a --no-edit
```
If the work is licensed/vendored from other people or projects, you may omit the license headers. Additionally, if you wish to retain authorship over a piece of code, you may attribute it to yourself; however, the code may be changed at any given point and brought under the attribution of Eden.
For more information on the license header script, run `.ci/license-header.sh -h`.
## Pull Requests
Pull requests are only to be merged by core developers when properly tested and discussions conclude on Discord or other communication channels. Labels are recommended but not required. However, all PRs MUST be namespaced and optionally typed:
```

Loading…
Cancel
Save