From e43d53381b8fa70ab923cc1091fe1ac07dd616c0 Mon Sep 17 00:00:00 2001 From: Romain Hugonnet Date: Wed, 20 Nov 2024 18:03:05 -0800 Subject: [PATCH] Move license header files to avoid GitHub misrecognizing license (#657) --- .../scripts/apply_license_header.py | 4 ++-- license-header.txt => .github/scripts/license-header.txt | 0 .pre-commit-config.yaml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) rename apply_license_header.py => .github/scripts/apply_license_header.py (90%) rename license-header.txt => .github/scripts/license-header.txt (100%) diff --git a/apply_license_header.py b/.github/scripts/apply_license_header.py similarity index 90% rename from apply_license_header.py rename to .github/scripts/apply_license_header.py index fe8952ff..5eb28c7c 100644 --- a/apply_license_header.py +++ b/.github/scripts/apply_license_header.py @@ -1,7 +1,7 @@ import os # Path to the license header -HEADER_FILE = "license-header.txt" +HEADER_FILE = os.path.join(os.path.dirname(__file__), "license-header.txt") # read license header with open(HEADER_FILE) as file: @@ -32,7 +32,7 @@ def apply_license_header_to_all_py_files(root_dir): add_license_header(file_path, license_header) -# Source repertory +# Source directory PROJECT_SRC = "xdem" # Add header to every source files diff --git a/license-header.txt b/.github/scripts/license-header.txt similarity index 100% rename from license-header.txt rename to .github/scripts/license-header.txt diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e9566b28..4d1edb1a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -128,8 +128,8 @@ repos: # Add license header to the source files - repo: local hooks: - - id: add-license_header + - id: add-license-header name: Add License Header - entry: python apply_license_header.py + entry: python .github/scripts/apply_license_header.py language: python files: \.py$