Skip to content

Commit

Permalink
chore: apply license format (apache#783)
Browse files Browse the repository at this point in the history
* chore: apply license format

Signed-off-by: tison <wander4096@gmail.com>

* ci: check license header

Signed-off-by: tison <wander4096@gmail.com>

* fix ci scripts

Signed-off-by: tison <wander4096@gmail.com>

* cargo fmt

Signed-off-by: tison <wander4096@gmail.com>

* apply suggestions

Signed-off-by: tison <wander4096@gmail.com>

* style

Signed-off-by: tison <wander4096@gmail.com>

* format

Signed-off-by: tison <wander4096@gmail.com>

* add license header instructions

Signed-off-by: tison <wander4096@gmail.com>

* retains more derived files header

Signed-off-by: tison <wander4096@gmail.com>

* txt unrelated

Signed-off-by: tison <wander4096@gmail.com>

---------

Signed-off-by: tison <wander4096@gmail.com>
Co-authored-by: chaokunyang <shawn.ck.yang@gmail.com>
  • Loading branch information
tisonkun and chaokunyang authored Jul 31, 2023
1 parent c9de481 commit e3d21c2
Show file tree
Hide file tree
Showing 471 changed files with 9,472 additions and 2,632 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
exclude =
python/build/
python/.eggs/
max-line-length = 88
max-line-length = 150
inline-quotes = "
ignore =
C408
Expand Down
14 changes: 14 additions & 0 deletions .github/sync.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2023 The Fury Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# 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.

fury-project/fury-sites@main:
- source: docs/guide/
dest: docs/guide/
Expand Down
24 changes: 20 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2023 The Fury Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# 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.

name: Fury CI

on:
Expand Down Expand Up @@ -67,7 +81,7 @@ jobs:
name: C++ CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
Expand All @@ -85,7 +99,7 @@ jobs:
matrix:
python-version: [3.6, 3.9]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
Expand All @@ -94,11 +108,13 @@ jobs:
run: ./ci/run_ci.sh install_bazel
- name: Run Python CI
run: ./ci/run_ci.sh python
Lint:
lint:
name: Code Style Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Check License Header
uses: korandoru/hawkeye@v3
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/release-java.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2023 The Fury Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# 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.

name: Publish Fury Java 📦

on:
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2023 The Fury Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# 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.

name: Publish Fury 📦

on:
Expand All @@ -16,7 +30,7 @@ jobs:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/sync.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2023 The Fury Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# 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.

name: Sync Files

on:
Expand All @@ -9,7 +23,7 @@ jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

# replace
- name: Replace Front Matter
Expand Down
18 changes: 15 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,31 +70,43 @@ go test -v fury_xlang_test.go
```

## Styling 😎
Run all checks:`bash ci/format.sh --all`

Run all checks: `bash ci/format.sh --all`

### License headers

```bash
docker run --rm -v $(pwd):/github/workspace ghcr.io/korandoru/hawkeye-native:v3 format
```

### Java

```bash
cd java
# license format
mvn -T10 license:format
# code format
mvn spotless:apply
# code format check
mvn spotless:check
mvn checkstyle:check
```
### Python

```bash
cd python
# install dependencies fro styling
pip install black==22.1.0 flake8==3.9.1 flake8-quotes flake8-bugbear
# format python code
black pyfury
```

### C++

```bash
git ls-files -- '*.cc' '*.h' | xargs -P 5 clang-format -i
```

### GoLang

```bash
cd go/fury
gofmt -s -w .
Expand Down
41 changes: 0 additions & 41 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -199,44 +199,3 @@
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.


Apache Software Foundation License 2.0
--------------------------------------
java/fury-core/src/main/java/io/fury/util/Platform.java is modified from https://github.com/apache/spark/blob/master/common/unsafe/src/main/java/org/apache/spark/unsafe/Platform.java

capitalize/uncapitalize/isBlank methods in java/fury-core/src/main/java/io/fury/util/StringUtils.java is copied from https://github.com/apache/commons-lang/blob/master/src/main/java/org/apache/commons/lang3/StringUtils.java

java/fury-core/src/main/java/io/fury/util/DateTimeUtils.java is modified from https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala

compare/swap/copy and absolute read/write methods in java/fury-core/src/main/java/io/fury/memory/MemoryBuffer.java is modified from https://github.com/apache/flink/blob/master/flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java

writeVarInt/writeVarLong in java/fury-core/src/main/java/io/fury/memory/MemoryBuffer.java is modified from https://github.com/EsotericSoftware/kryo/blob/master/src/com/esotericsoftware/kryo/unsafe/UnsafeOutput.java

java/fury-core/src/main/java/io/fury/util/{FuryObjectMap/ObjectIntMap/IdentityMap/IdentityObjectIntMap/LongMap}.java are adapted from https://github.com/EsotericSoftware/kryo/blob/master/src/com/esotericsoftware/kryo/util/{ObjectMap/ObjectIntMap/IdentityMap/IdentityObjectIntMap/IntMap}.java

{ParentClassLoader/ChildFirstURLClassLoader} in java/fury-core/src/main/java/io/fury/util/ClassLoaderUtils.java is copied from https://github.com/apache/spark/blob/master/core/src/main/java/org/apache/spark/util/{ParentClassLoader/ChildFirstURLClassLoader}.java

java/fury-core/src/main/java/io/fury/type/Generics.java is modified from https://github.com/EsotericSoftware/kryo/blob/master/src/com/esotericsoftware/kryo/util/DefaultGenerics.java

java/fury-core/src/test/java/io/fury/type/GenericsTest.java is modified from https://github.com/EsotericSoftware/kryo/blob/master/test/com/esotericsoftware/kryo/util/GenericsUtilTest.java

java/fury-core/src/main/java/io/fury/io/ClassLoaderObjectInputStream.java is copied from https://github.com/apache/commons-io/blob/master/src/main/java/org/apache/commons/io/input/ClassLoaderObjectInputStream.java

java/fury-core/src/main/java/io/fury/memory/BitUtils.java is modified from https://github.com/apache/spark/blob/master/common/unsafe/src/main/java/org/apache/spark/unsafe/bitset/BitSetMethods.java and https://github.com/apache/arrow/blob/main/java/vector/src/main/java/org/apache/arrow/vector/BitVectorHelper.java

src/main/java/io/fury/format/row/Getters.java is modified from https://github.com/apache/spark/blob/master/sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/SpecializedGetters.java

java/fury-core/src/main/java/io/fury/codegen/Code.java is modified from https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/javaCode.scala

src/main/java/io/fury/format/vectorized/ArrowWriter.java is modified from https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/execution/arrow/ArrowWriter.scala

bazel/arrow/pyarrow_configure.bzl is modified from https://github.com/tensorflow/tensorflow/blob/5a244072f2b33d2347e803146c244c179c1ddb75/third_party/py/python_configure.bzl

ci/format.sh is modified from https://github.com/ray-project/ray/blob/master/ci/lint/format.sh

lazy_import method in python/pyfury/util.py is copied from https://github.com/mars-project/mars/blob/master/mars/utils.py

dataslots in pytho/pyfury/type.py is copied from https://github.com/ericvsmith/dataclasses/blob/master/dataclass_tools.py

java/fury-benchmark/src/main/java/io/fury/benchmark/Identity2IdMap.java is modified from https://github.com/RuedigerMoeller/fast-serialization/blob/master/src/main/java/org/nustaq/serialization/util/FSTIdentity2IdMap.java to benchmark identity map performance
5 changes: 3 additions & 2 deletions bazel/arrow/pyarrow_configure.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Setup pyarrow as external dependency.
See https://github.com/tensorflow/tensorflow/blob/5a244072f2b33d2347e803146c244c179c1ddb75/third_party/py/python_configure.bzl """
"""Setup pyarrow as external dependency."""

# This file is derived from https://github.com/tensorflow/tensorflow/blob/5a244072f2b33d2347e803146c244c179c1ddb75/third_party/py/python_configure.bzl.

def _tpl(repository_ctx, tpl, substitutions = {}, out = None):
if not out:
Expand Down
17 changes: 16 additions & 1 deletion ci/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
#!/bin/bash
#!/usr/bin/env bash

# Copyright 2023 The Fury Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# 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 -x

Expand Down
5 changes: 3 additions & 2 deletions ci/format.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/env bash

# This script is derived from https://github.com/ray-project/ray/blob/5ce25a57a0949673d17f3a8784f05b2d65290524/ci/lint/format.sh.

# Black + Clang formatter (if installed). This script formats all changed files from the last mergebase.
# You are encouraged to run this locally before pushing changes for review.

Expand Down Expand Up @@ -190,7 +193,6 @@ format_all() {
if command -v mvn >/dev/null ; then
echo "Maven installed"
cd "$ROOT/java"
mvn -T10 license:format
mvn -T10 spotless:apply
mvn -T10 checkstyle:check
else
Expand Down Expand Up @@ -252,7 +254,6 @@ format_changed() {
if command -v mvn >/dev/null ; then
echo "Maven installed"
cd "$ROOT/java"
mvn -T10 license:format
mvn -T10 spotless:apply
mvn -T10 checkstyle:check
else
Expand Down
17 changes: 16 additions & 1 deletion ci/run_ci.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
#! /usr/bin/env bash
#!/usr/bin/env bash

# Copyright 2023 The Fury Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# 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 -e
set -x

Expand Down
17 changes: 17 additions & 0 deletions integration_tests/pom.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
<!--
Copyright 2023 The Fury Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2023 The Fury Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.
*/

package io.fury.integration_tests;

import io.fury.benchmark.state.ObjectType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2023 The Fury Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.
*/

package io.fury.integration_tests;

import io.fury.benchmark.data.MediaContent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2023 The Fury Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.
*/

package io.fury.integration_tests.state;

import java.util.List;
Expand Down
Loading

0 comments on commit e3d21c2

Please sign in to comment.