Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Migrate to SPDX headers #12204

Merged
merged 5 commits into from
Apr 26, 2024
Merged

chore: Migrate to SPDX headers #12204

merged 5 commits into from
Apr 26, 2024

Conversation

nickvergessen
Copy link
Member

@nickvergessen nickvergessen commented Apr 24, 2024

No description provided.

@Antreesy
Copy link
Contributor

Don't we need to set up a workflow for checking compliance? Or something for later?

@AndyScherzinger
Copy link
Member

We have a GH action in the template repo but it will fail until you reach full compliance. So better get there first and than add the action, else you have a failing action on any PR until then.

Copy link
Member

@AndyScherzinger AndyScherzinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just some very minor comments, 👍

lib/CachePrefix.php Outdated Show resolved Hide resolved
@AndyScherzinger AndyScherzinger force-pushed the chore/spdx branch 2 times, most recently from db617dc to 8484ec8 Compare April 25, 2024 11:07
@nickvergessen nickvergessen changed the title chore: Migrate to SPDX headers - Part 1 chore: Migrate to SPDX headers Apr 26, 2024
@nickvergessen nickvergessen force-pushed the chore/spdx branch 2 times, most recently from e383474 to d77af85 Compare April 26, 2024 11:18
Copy link
Contributor

@Antreesy Antreesy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's around 60 files without a creation year in copyright header. But given amount of changes, I guess, we are good for now, that's something could be added for later, if CI is green now

@Antreesy
Copy link
Contributor

UPD: here are missing years: 24ad3a6

directory="."
substring="SPDX-FileCopyrightText: Nextcloud"

# Find files recursively in the directory
find "$directory" -type f -exec grep -l "$substring" {} + | while IFS= read -r file
do
    # Get the creation year of the file
    creation_year=$(git log --diff-filter=A --follow --format=%aI "$file" | tail -n 1 | cut -d'-' -f1)
    echo "$creation_year"

    # Insert the creation year at the specified place in the file
    sed -i "s~$substring~SPDX-FileCopyrightText: $creation_year Nextcloud~g" "$file"
done

@nickvergessen
Copy link
Member Author

Feel free to commit

@AndyScherzinger AndyScherzinger merged commit 8ef7b2e into main Apr 26, 2024
64 checks passed
@AndyScherzinger AndyScherzinger deleted the chore/spdx branch April 26, 2024 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants