Skip to content

Commit

Permalink
[Utils] Teach lint-copyright-notices.py about public license notice…
Browse files Browse the repository at this point in the history
…s (#35682)

Files with public licenses have been added to the ignore list of the
license checker. This obviously lead to some of these files having
incorrect or missing license notices. This patch fixes this script so
that it now has a list of files it should treat as public. All changes
except the script itself are NFC, but please review to ensure they now
got the correct license.

Closes [Internal Link]

modular-orig-commit: 9018362dca667d98efd8db69bfd3273c92c39ac4
  • Loading branch information
laszlokindrat authored Mar 25, 2024
1 parent a806b86 commit 9517cd9
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 13 deletions.
9 changes: 8 additions & 1 deletion examples/ProcessNotebooks.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
##===----------------------------------------------------------------------===##
# Copyright (c) 2024, Modular Inc. All rights reserved.
#
# This file is Modular Inc proprietary.
# Licensed under the Apache License v2.0 with LLVM Exceptions:
# https://llvm.org/LICENSE.txt
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##===----------------------------------------------------------------------===##

# Read the notebook and strip out the CHECK lines first thing.
Expand Down
13 changes: 13 additions & 0 deletions examples/check_mod.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# ===----------------------------------------------------------------------=== #
# Copyright (c) 2024, Modular Inc. All rights reserved.
#
# Licensed under the Apache License v2.0 with LLVM Exceptions:
# https://llvm.org/LICENSE.txt
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ===----------------------------------------------------------------------=== #

import shutil
import subprocess
from importlib.util import find_spec
Expand Down
4 changes: 2 additions & 2 deletions examples/docker/build-image.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# ===----------------------------------------------------------------------=== #
##===----------------------------------------------------------------------===##
# Copyright (c) 2023, Modular Inc. All rights reserved.
#
# Licensed under the Apache License v2.0 with LLVM Exceptions:
Expand All @@ -10,7 +10,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ===----------------------------------------------------------------------=== #
##===----------------------------------------------------------------------===##
set -e

# Usage
Expand Down
3 changes: 2 additions & 1 deletion examples/mandelbrot.mojo
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
# limitations under the License.
# ===----------------------------------------------------------------------=== #

# RUN: %mojo -debug-level full %s | FileCheck %s

from math import iota
from sys.info import num_logical_cores

# RUN: %mojo -debug-level full %s | FileCheck %s
import benchmark
from algorithm import parallelize, vectorize
from complex import ComplexFloat64, ComplexSIMD
Expand Down
2 changes: 1 addition & 1 deletion stdlib/scripts/build-stdlib.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# ===----------------------------------------------------------------------=== #
##===----------------------------------------------------------------------===##
# Copyright (c) 2024, Modular Inc. All rights reserved.
#
# Licensed under the Apache License v2.0 with LLVM Exceptions:
Expand Down
10 changes: 8 additions & 2 deletions stdlib/scripts/check-doc-strings.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
#!/usr/bin/env bash
##===----------------------------------------------------------------------===##
# Copyright (c) 2024, Modular Inc. All rights reserved.
#
# This file is Modular Inc proprietary.
# Licensed under the Apache License v2.0 with LLVM Exceptions:
# https://llvm.org/LICENSE.txt
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##===----------------------------------------------------------------------===##

set -euo pipefail
Expand All @@ -25,4 +32,3 @@ mkdir -p "${BUILD_DIR}"

check_doc_string stdlib
check_doc_string test_utils

4 changes: 2 additions & 2 deletions stdlib/scripts/run-tests.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# ===----------------------------------------------------------------------=== #
##===----------------------------------------------------------------------===##
# Copyright (c) 2024, Modular Inc. All rights reserved.
#
# Licensed under the Apache License v2.0 with LLVM Exceptions:
Expand All @@ -10,7 +10,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ===----------------------------------------------------------------------=== #
##===----------------------------------------------------------------------===##

set -euo pipefail

Expand Down
2 changes: 1 addition & 1 deletion stdlib/src/pathlib/__init__.mojo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ===----------------------------------------------------------------------===
# ===----------------------------------------------------------------------=== #
# Copyright (c) 2024, Modular Inc. All rights reserved.
#
# Licensed under the Apache License v2.0 with LLVM Exceptions:
Expand Down
11 changes: 9 additions & 2 deletions stdlib/test/lit.cfg.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
# ===----------------------------------------------------------------------=== #
# Copyright (c) 2024, Modular Inc. All rights reserved.
#
# This file is Modular Inc proprietary.
# Licensed under the Apache License v2.0 with LLVM Exceptions:
# https://llvm.org/LICENSE.txt
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ===----------------------------------------------------------------------=== #

from pathlib import Path
import os
import platform
import shutil
from pathlib import Path

import lit.formats
import lit.llvm
Expand Down
10 changes: 9 additions & 1 deletion stdlib/test/python/my_module.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
# ===----------------------------------------------------------------------=== #
# Copyright (c) 2024, Modular Inc. All rights reserved.
#
# This file is Modular Inc proprietary.
# Licensed under the Apache License v2.0 with LLVM Exceptions:
# https://llvm.org/LICENSE.txt
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ===----------------------------------------------------------------------=== #

from abc import ABC, abstractmethod


Expand Down

0 comments on commit 9517cd9

Please sign in to comment.