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

chore: enable allow-license & exclude style dir #119

Merged
merged 3 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ apache-release.sh export-ignore
# ignored directory
.github/ export-ignore
.idea/ export-ignore
style/ export-ignore
scripts/ export-ignore
8 changes: 4 additions & 4 deletions .github/workflows/check-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ jobs:
- name: 'Checkout Repository'
uses: actions/checkout@v4
- name: 'Dependency Review'
uses: actions/dependency-review-action@v3
uses: actions/dependency-review-action@v4
# Refer: https://github.com/actions/dependency-review-action
with:
fail-on-severity: low
comment-summary-in-pr: on-failure
# Action will fail if dependencies don't match the list
#allow-licenses: Apache-2.0, MIT
deny-licenses: GPL-3.0, AGPL-1.0, AGPL-3.0, LGPL-2.0, CC-BY-3.0
# Action will fail if dependencies don't match the list (we could choose only one of the following)
allow-licenses: Apache-2.0, MIT
#deny-licenses: GPL-3.0, AGPL-1.0, AGPL-3.0, LGPL-2.0, CC-BY-3.0

check-license:
runs-on: ubuntu-latest
Expand Down
43 changes: 43 additions & 0 deletions style/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#! /bin/bash
imbajin marked this conversation as resolved.
Show resolved Hide resolved

BLACK=false
PYLINT=false
ROOT_DIR=$(pwd)
echo ${ROOT_DIR}
# Parse command line arguments
while getopts ":bp" opt; do
case ${opt} in
b )
BLACK=true
;;
p )
PYLINT=true
;;
\? )
echo "Usage: cmd [-b] [-p]"
;;
esac
done

# If no arguments were provided, run both BLACK and PYLINT
if [ "$BLACK" = false ] && [ "$PYLINT" = false ]; then
BLACK=true
PYLINT=true
fi

# Run BLACK if -b is specified
if [ "$BLACK" = true ] ; then
echo "[black] Start to check code style and auto format"
# https://github.com/psf/BLACK/issues/1802
black --line-length=120 ${ROOT_DIR}
fi

# Run PYLINT if -p is specified
if [ "$PYLINT" = true ] ; then
echo "[pylint] Start code analysis and check,
we need to manually fix all the warnings mentioned below before commit! "
export PYTHONPATH=${ROOT_DIR}/hugegraph-llm/src:${ROOT_DIR}/hugegraph-python-client/src:${ROOT_DIR}/hugegraph-ml/src
pylint --rcfile=${ROOT_DIR}/style/pylint.conf ${ROOT_DIR}/hugegraph-llm
pylint --rcfile=${ROOT_DIR}/style/pylint.conf ${ROOT_DIR}/hugegraph-ml
pylint --rcfile=${ROOT_DIR}/style/pylint.conf --disable C0103 ${ROOT_DIR}/hugegraph-python-client
fi
Loading