Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -291,3 +291,6 @@ tags
[._]*.un~

# End of https://www.toptal.com/developers/gitignore/api/vim,linux,macos,python,emacs

# Copyright Holder
COPYRIGHT_HOLDER
4 changes: 3 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ repos:
name: Update CONTRIBUTORS.md
entry: bash ./scripts/generate_contributors.sh
language: system
files: .
pass_filenames: false
always_run: true
stages: [commit]
- repo: local
hooks:
- id: add-spdx
Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# If the `COPYRIGHT_HOLDER` file exists and contains a string shorter than 50 characters,
# use it as the name of the copyright holder.
# If not, fall back to the default value: "Ethersecurity Inc."
copyright_holder ?= $(shell bash scripts/get_copyright.sh)
change_files ?= $(shell bash scripts/get_changed_files.sh)

install-dev:
pip install -e .[dev]

Expand All @@ -9,7 +15,7 @@ lint-license:

annotate-SPD:
@echo "📎 Annotating files..."
reuse annotate --license MPL-2.0 --copyright "Ethersecurity" $(shell git ls-files '*.py' '*.sh')
reuse annotate --license MPL-2.0 --copyright "${copyright_holder}" ${change_files}
pre-commit-refresh:
@echo "🧹 Cleaning pre-commit cache..."
pre-commit clean
Expand Down
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ The binary will be generated in the `dist/` directory, compressed using UPX (if

- Licensed under **MPL-2.0**.
- Files include SPDX headers and author metadata.

- Please use the following before committing:

```bash
Expand All @@ -116,6 +117,31 @@ make add-author

---

### Changing the Copyright Holder

To change the copyright holder name inserted into source files:

1. Create a file named `COPYRIGHT_HOLDER` in the root of the repository, and write your name or your organization’s name in it.
For example:

```bash
echo "Your Name or Organization" > COPYRIGHT_HOLDER
```

> ⚠️ Note: This file is `.gitignore`'d and should not be committed.

2. Run `make annotate-SPD` (or the relevant pre-commit hook) to re-annotate modified source files with the new copyright holder name.

- This target internally calls `reuse annotate` to update SPDX headers.
- Only `.py` and `.sh` files tracked by git are affected.

```bash
make annotate-SPD
```

> **Important**: The value in `COPYRIGHT_HOLDER` must be under 50 characters.
---

## 🤝 Contributing

Contributions are welcome!
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# SPDX-FileCopyrightText: 2025 Ethersecurity
# SPDX-FileCopyrightText: 2025 Ethersecurity Inc.
#
# SPDX-License-Identifier: MPL-2.0

Expand Down
2 changes: 1 addition & 1 deletion fireblocks_cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2025 Ethersecurity
# SPDX-FileCopyrightText: 2025 Ethersecurity Inc.
#
# SPDX-License-Identifier: MPL-2.0

Expand Down
2 changes: 1 addition & 1 deletion fireblocks_cli/commands/configure.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2025 Ethersecurity
# SPDX-FileCopyrightText: 2025 Ethersecurity Inc.
#
# SPDX-License-Identifier: MPL-2.0

Expand Down
2 changes: 1 addition & 1 deletion fireblocks_cli/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2025 Ethersecurity
# SPDX-FileCopyrightText: 2025 Ethersecurity Inc.
#
# SPDX-License-Identifier: MPL-2.0

Expand Down
2 changes: 1 addition & 1 deletion fireblocks_cli/crypto.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2025 Ethersecurity
# SPDX-FileCopyrightText: 2025 Ethersecurity Inc.
#
# SPDX-License-Identifier: MPL-2.0

Expand Down
2 changes: 1 addition & 1 deletion fireblocks_cli/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3

# SPDX-FileCopyrightText: 2025 Ethersecurity
# SPDX-FileCopyrightText: 2025 Ethersecurity Inc.
#
# SPDX-License-Identifier: MPL-2.0

Expand Down
2 changes: 1 addition & 1 deletion scripts/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2025 Ethersecurity
# SPDX-FileCopyrightText: 2025 Ethersecurity Inc.
#
# SPDX-License-Identifier: MPL-2.0

Expand Down
2 changes: 1 addition & 1 deletion scripts/add_author.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3

# SPDX-FileCopyrightText: 2025 Ethersecurity
# SPDX-FileCopyrightText: 2025 Ethersecurity Inc.
#
# SPDX-License-Identifier: MPL-2.0

Expand Down
2 changes: 1 addition & 1 deletion scripts/check_signoff.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

# SPDX-FileCopyrightText: 2025 Ethersecurity
# SPDX-FileCopyrightText: 2025 Ethersecurity Inc.
#
# SPDX-License-Identifier: MPL-2.0

Expand Down
9 changes: 7 additions & 2 deletions scripts/generate_contributors.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
#!/bin/bash

# SPDX-FileCopyrightText: 2025 Ethersecurity
# SPDX-FileCopyrightText: 2025 Ethersecurity Inc.
#
# SPDX-License-Identifier: MPL-2.0

# Author: Shohei KAMON <cameong@stir.network>

set -x

rm CONTRIBUTORS.md
echo '# Contributors' > CONTRIBUTORS.md
echo "" >> CONTRIBUTORS.md
echo "This project is developed with contributions from the following individuals:" >> CONTRIBUTORS.md
echo "" >> CONTRIBUTORS.md
echo "<!-- The list below is automatically generated. Do not edit manually. -->" >> CONTRIBUTORS.md
echo "" >> CONTRIBUTORS.md

# Get unique contributors in the format: Name <email>
# Sorted in chronological order (oldest first)
# With duplicates removed
# Each entry formatted as "- Name <email>"
git log --format='%aN <%aE>' | tac | awk '!seen[$0]++ { print "- " $0 }' >> CONTRIBUTORS.md
9 changes: 9 additions & 0 deletions scripts/get_changed_files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

# SPDX-FileCopyrightText: 2025 Ethersecurity Inc.
#
# SPDX-License-Identifier: MPL-2.0

# Author: Shohei KAMON <cameong@stir.network>

git status --porcelain | grep -v "^??" | cut -c4- | grep -e "\.sh$" -e "\.py$"
21 changes: 21 additions & 0 deletions scripts/get_copyright.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

# SPDX-FileCopyrightText: 2025 Ethersecurity Inc.
#
# SPDX-License-Identifier: MPL-2.0

# Author: Shohei KAMON <cameong@stir.network>

if [ ! -s COPYRIGHT_HOLDER ]; then
echo "Ethersecurity Inc."
exit 0
fi

val=$(cat COPYRIGHT_HOLDER)

if [ ${#val} -le 50 ]; then
echo "$val"
else
echo "ERROR: COPYRIGHT_HOLDER is too long (>50 chars)" >&2
exit 1
fi