Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Add copyright to all source files #20

Closed
michaelgoin opened this issue Aug 4, 2020 · 0 comments
Closed

Add copyright to all source files #20

michaelgoin opened this issue Aug 4, 2020 · 0 comments

Comments

@michaelgoin
Copy link
Member

Every source file in the repository should contain the copyright block heading on top:

/*
* Copyright 2020 New Relic Corporation. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/

This includes bash scripts (slightly different commenting style) and code examples. Does not include copy-paste templates.

NOTE: we want the Apache-2.0 license to land first so these are consistent and that license is the current active for the commit(s) applying these changes.


Useful Script

  • Does not update non-JS files.
  • May break when there’s a code directive that needs to be at the top.
  • May need additional modifications for a particular repository.
  • Run git ls-files | grep '\.js$' | grep -Ev '(.eslintrc|^newrelic)' to see list of files
tmp=$(mktemp)   # Create a temporary file
trap "rm -f $tmp; exit 1" 0 1 2 3 13 15

header="/*
 * Copyright 2020 New Relic Corporation. All rights reserved.
 * SPDX-License-Identifier: Apache-2.0
 */
"

for file in $(git ls-files | grep '\.js$' | grep -Ev '(.eslintrc|^newrelic)')
do
    {
    echo -e "$header"
    cat $file
    } > $tmp
    mv $tmp $file
    echo $file
done

rm -f $tmp
trap 0
@michaelgoin michaelgoin added this to To do in mysql - OSS & CLI Migration via automation Aug 4, 2020
@carlo-808 carlo-808 moved this from To do to In progress in mysql - OSS & CLI Migration Aug 5, 2020
@carlo-808 carlo-808 self-assigned this Aug 5, 2020
@carlo-808 carlo-808 moved this from In progress to Needs Review in mysql - OSS & CLI Migration Aug 5, 2020
@carlo-808 carlo-808 moved this from Needs Review to Done in mysql - OSS & CLI Migration Aug 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

2 participants