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

Updating copyright headers to match current best practices #1301

Merged
merged 20 commits into from
May 26, 2020
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
66 changes: 66 additions & 0 deletions .github/check_license.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/usr/bin/env bash
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

echo
echo "==========================="
echo "Check SPDX identifier"
echo "==========================="
echo

ERROR_FILES=""
FILES_TO_CHECK=`find . \
-size +0 -type f \( -name '*.sh' -o -name '*.py' -o -name 'Makefile' -o -name '*.tcl' \) \
\( -not -path "*/.*/*" -not -path "*/third_party/*" -not -path "*/database/*" -not -path "*/env/*" -not -path "*/build/*" \)`

for file in $FILES_TO_CHECK; do
echo "Checking $file"
grep -q "SPDX-License-Identifier" $file || ERROR_FILES="$ERROR_FILES $file"
done

if [ ! -z "$ERROR_FILES" ]; then
for file in $ERROR_FILES; do
echo "ERROR: $file does not have license information."
done
exit 1
fi

echo
echo "==========================="
echo "Check third party LICENSE"
echo "==========================="
echo

function check_if_submodule {
for submodule in `git submodule --quiet foreach 'echo $sm_path'`; do
if [ "$1" == "$submodule" ]; then
return 1
fi
done
}

THIRD_PARTY_DIRS=""
if [[ -e third_party ]]; then
THIRD_PARTY_DIRS=`ls third_party --ignore=reformat.tcl --ignore cctz --ignore gflags --ignore yosys `
fi
ERROR_NO_LICENSE=""

for dir in $THIRD_PARTY_DIRS; do
# Checks if we are not in a submodule
if check_if_submodule $dir; then
echo "Checking third_party/$dir"
[ -f third_party/$dir/LICENSE ] || ERROR_NO_LICENSE="$ERROR_NO_LICENSE $dir"
fi
done

if [ ! -z "$ERROR_NO_LICENSE" ]; then
for dir in $ERROR_NO_LICENSE; do
echo "ERROR: $dir does not have the LICENSE file."
done
exit 1
fi
45 changes: 45 additions & 0 deletions .github/check_python_scripts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env bash
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

echo
echo "==================================="
echo "Check Python UTF coding and shebang"
echo "==================================="
echo

ERROR_FILES_SHEBANG=""
ERROR_FILES_UTF_CODING=""
FILES_TO_CHECK=`find . \
-size +0 -type f \( -name '*.py' \) \
\( -not -path "*/.*/*" -not -path "*/third_party/*" -not -path "*/env/*" \)`

for file in $FILES_TO_CHECK; do
echo "Checking $file"
if [[ -x $file ]]; then
grep -q "\#\!/usr/bin/env python3" $file || ERROR_FILES_SHEBANG="$ERROR_FILES_SHEBANG $file"
fi
grep -q "\#.*coding: utf-8" $file || ERROR_FILES_UTF_CODING="$ERROR_FILES_UTF_CODING $file"
done

if [ ! -z "$ERROR_FILES_SHEBANG" ]; then
for file in $ERROR_FILES_SHEBANG; do
echo "ERROR: $file does not have the python3 shebang."
done
exit 1
fi

if [ ! -z "$ERROR_FILES_UTF_CODING" ]; then
for file in $ERROR_FILES_UTF_CODING; do
echo "ERROR: $file does not have the UTF encoding set."
echo "Add # coding: utf-8"
done
exit 1
fi

echo
7 changes: 7 additions & 0 deletions .github/kokoro/db-full.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/bin/bash
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

set -e

Expand Down
7 changes: 7 additions & 0 deletions .github/kokoro/db-quick.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/bin/bash
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

set -e

Expand Down
9 changes: 9 additions & 0 deletions .github/kokoro/kokoro-cfg.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

db_full = """\
# Format: //devtools/kokoro/config/proto/build.proto
Expand Down
7 changes: 7 additions & 0 deletions .github/kokoro/steps/git.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/bin/bash
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

set -e

Expand Down
7 changes: 7 additions & 0 deletions .github/kokoro/steps/hostinfo.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/bin/bash
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

set -e

Expand Down
7 changes: 7 additions & 0 deletions .github/kokoro/steps/hostsetup.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/bin/bash
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

set -e

Expand Down
7 changes: 7 additions & 0 deletions .github/kokoro/steps/prjxray-env.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/bin/bash
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

set -e

Expand Down
7 changes: 7 additions & 0 deletions .github/kokoro/steps/xilinx.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/bin/bash
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

# Fix up things related to Xilinx tool chain.

Expand Down
7 changes: 7 additions & 0 deletions .github/kokoro/tests.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/bin/bash
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

set -e

Expand Down
9 changes: 9 additions & 0 deletions .github/update-contributing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

# Header
contrib = ["""\
Expand Down
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,8 @@ jobs:
script:
- make format
- test $(git status --porcelain | wc -l) -eq 0 || { git diff; false; }

- name: "License Checks"
script:
- ./.github/check_license.sh
- ./.github/check_python_scripts.sh
20 changes: 20 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This is the list of Project X-Ray's significant contributors.
#
# This does not necessarily list everyone who has contributed code,
# especially since many employees of one corporation may be contributing.
# To see the full list of contributors, see the revision history in
# source control.
Antmicro
Google LLC
Claire Wolf
Rick Altherr
Jake Mercer
Mehdi Khairy
Davide
Herbert Poetzl
Mitja Kleider
Oguz Meteer
David Shah
Felix Held
Leonardo Romor
Paul Schulz
2 changes: 1 addition & 1 deletion COPYING → LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (C) 2017 The Project X-Ray Authors. All rights reserved.
Copyright (C) 2017-2020 The Project X-Ray Authors.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
Expand Down
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
SHELL = bash
ALL_EXCLUDE = third_party .git env build docs/env

Expand Down Expand Up @@ -118,6 +125,12 @@ format: format-cpp format-docs format-py format-tcl format-trailing-ws

.PHONY: format format-cpp format-py format-tcl format-trailing-ws

check-license:
@./.github/check_license.sh
@./.github/check_python_scripts.sh

.PHONY: check-license

# Targets related to Project X-Ray databases
# ------------------------

Expand Down
7 changes: 7 additions & 0 deletions database/Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
# Minimal makefile for Sphinx documentation
#

Expand Down
7 changes: 7 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
#
# Project X-Ray documentation build configuration file, created by
# sphinx-quickstart on Mon Feb 5 11:04:37 2018.
Expand Down
7 changes: 7 additions & 0 deletions download-latest-db.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/usr/bin/env bash
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
tmichalak marked this conversation as resolved.
Show resolved Hide resolved

GITHUB_PROTO=${1:-https}
GITHUB_URL=$GITHUB_PROTO://github.com/SymbiFlow/prjxray-db.git
Expand Down
7 changes: 7 additions & 0 deletions experiments/clbpips/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

N := 5
SPECIMENS := $(addprefix specimen_,$(shell seq -f '%03.0f' $(N)))
Expand Down
9 changes: 9 additions & 0 deletions experiments/clbpips/generate.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

from prjxray.segmaker import Segmaker

Expand Down
7 changes: 7 additions & 0 deletions experiments/clbpips/generate.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/bin/bash
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

source ../../utils/environment.sh
source ${XRAY_GENHEADER}
Expand Down
7 changes: 7 additions & 0 deletions experiments/clbpips/generate.tcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Copyright (C) 2017-2020 The Project X-Ray Authors
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
create_project -force -part $::env(XRAY_PART) design design

read_verilog ../top.v
Expand Down
Loading