mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-06 15:59:16 +08:00
1 parent
4abfc0f002
commit
9efcfad4f3
5 files changed
+72
-6
No files matched your search
@@ -24,6 +24,9 @@ jobs:
|
|||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install -r environment/requirements.txt
|
pip install -r environment/requirements.txt
|
||||||
pip install -e .
|
pip install -e .
|
||||||
|
- name: Run license checks
|
||||||
|
run: |
|
||||||
|
./scripts/licensing/license_headers.sh --check
|
||||||
- name: Run Black
|
- name: Run Black
|
||||||
run: black pyrad/ notebooks/ --check
|
run: black pyrad/ notebooks/ --check
|
||||||
- name: Python Pylint
|
- name: Python Pylint
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
# Copyright 2022 The Plenoptix Team. All rights reserved.
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
@@ -1,3 +1,17 @@
|
|||||||
|
# Copyright 2022 The Plenoptix Team. All rights reserved.
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Some helpful functions for creating geometric transformations.
|
Some helpful functions for creating geometric transformations.
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import sys
|
|||||||
|
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
LOCAL_TESTS = ["Run Black", "Python Pylint", "Test with pytest"]
|
LOCAL_TESTS = ["Run license checks", "Run Black", "Python Pylint", "Test with pytest"]
|
||||||
|
|
||||||
|
|
||||||
def run_command(command):
|
def run_command(command):
|
||||||
@@ -25,6 +25,7 @@ if __name__ == "__main__":
|
|||||||
for step in steps:
|
for step in steps:
|
||||||
if "name" in step and step["name"] in LOCAL_TESTS:
|
if "name" in step and step["name"] in LOCAL_TESTS:
|
||||||
compressed = step["run"].replace("\n", ";").replace("\\", "")
|
compressed = step["run"].replace("\n", ";").replace("\\", "")
|
||||||
|
compressed = compressed.replace("--check", "")
|
||||||
curr_command = f"{compressed}"
|
curr_command = f"{compressed}"
|
||||||
|
|
||||||
print("*" * 100)
|
print("*" * 100)
|
||||||
@@ -38,10 +39,6 @@ if __name__ == "__main__":
|
|||||||
print_green("Building Documentation")
|
print_green("Building Documentation")
|
||||||
run_command("cd docs/; make html; cd ../")
|
run_command("cd docs/; make html; cd ../")
|
||||||
|
|
||||||
# Add licensing to all pyrad files
|
|
||||||
print_green("Add licensing headers")
|
|
||||||
run_command("./scripts/licensing/license_headers.sh")
|
|
||||||
|
|
||||||
print("\n")
|
print("\n")
|
||||||
print_green("=" * 100)
|
print_green("=" * 100)
|
||||||
print_green("ALL CHECKS PASSED")
|
print_green("ALL CHECKS PASSED")
|
||||||
|
|||||||
@@ -1,9 +1,48 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
VALID_ARGS=$(getopt -o c --long check -- "$@")
|
||||||
|
|
||||||
|
eval set -- "$VALID_ARGS"
|
||||||
|
check=false
|
||||||
|
while [ : ]; do
|
||||||
|
case "$1" in
|
||||||
|
-c | --check)
|
||||||
|
check=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--) shift;
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
check_failed=false
|
||||||
|
added_headers=false
|
||||||
for i in $(find pyrad/ -name '*.py');
|
for i in $(find pyrad/ -name '*.py');
|
||||||
do
|
do
|
||||||
if ! grep -q Copyright $i
|
if ! grep -q Copyright $i
|
||||||
then
|
then
|
||||||
cat scripts/licensing/copyright.txt $i >$i.new && mv $i.new $i
|
if [ "$check" = true ];
|
||||||
|
then
|
||||||
|
echo "$i missing copyright header"
|
||||||
|
check_failed=true
|
||||||
|
else
|
||||||
|
cat scripts/licensing/copyright.txt $i >$i.new && mv $i.new $i
|
||||||
|
echo "Adding license header to $i."
|
||||||
|
fi
|
||||||
|
added_headers=true
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ "$check_failed" = true ];
|
||||||
|
then
|
||||||
|
echo "Run '.scripts/licensing/license_headers.sh to add missing headers.'"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$added_headers" = false ];
|
||||||
|
then
|
||||||
|
echo "No missing license headers found."
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0
|
||||||
Reference in new issue
Block a user