pre-commit fix and update config to ignore community use case

This commit is contained in:
Wendong 2025-04-11 10:33:11 +08:00
parent 7181dd25cc
commit 6727c53055
6 changed files with 34 additions and 11 deletions

View File

@ -4,9 +4,9 @@ repos:
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
exclude: ^docs/cookbooks/ # Ignore files under docs/cookbooks
exclude: ^(docs/cookbooks/|community_usecase/) # Ignore files under docs/cookbooks and community_usecase
- id: ruff-format
exclude: ^docs/cookbooks/ # Ignore files under docs/cookbooks
exclude: ^(docs/cookbooks/|community_usecase/) # Ignore files under docs/cookbooks and community_usecase
- repo: local
hooks:
@ -17,7 +17,7 @@ repos:
types: [python]
pass_filenames: false
require_serial: true
exclude: ^docs/cookbooks/ # Ignore files under docs/cookbooks
exclude: ^(docs/cookbooks/|community_usecase/) # Ignore files under docs/cookbooks and community_usecase
- repo: local
hooks:
@ -26,7 +26,7 @@ repos:
entry: python licenses/update_license.py . licenses/license_template.txt
language: system
types: [python]
exclude: ^docs/cookbooks/ # Ignore files under docs/cookbooks
exclude: ^(docs/cookbooks/|community_usecase/) # Ignore files under docs/cookbooks and community_usecase
- repo: https://github.com/codespell-project/codespell
# Configuration for codespell is in pyproject.toml

View File

@ -1,3 +1,16 @@
# ========= Copyright 2023-2024 @ CAMEL-AI.org. 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.
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
import sys
import pathlib
from dotenv import load_dotenv
@ -132,4 +145,4 @@ def main():
if __name__ == "__main__":
main()
main()

View File

@ -16,12 +16,9 @@ import pathlib
from dotenv import load_dotenv
from camel.models import ModelFactory
from camel.toolkits import (
AudioAnalysisToolkit,
CodeExecutionToolkit,
ExcelToolkit,
ImageAnalysisToolkit,
SearchToolkit,
VideoAnalysisToolkit,
BrowserToolkit,
FileWriteToolkit,
)

View File

@ -92,6 +92,9 @@ def update_license_in_directory(
continue
if any(part.startswith(".") for part in py_files.parts):
continue
# Skip files in the community_usecase directory
if "community_usecase" in py_files.parts:
continue
if update_license_in_file(
py_files,
license_template_path,

View File

@ -1300,7 +1300,12 @@ def main():
app = create_ui()
app.queue()
app.launch(share=False, favicon_path=os.path.join(os.path.dirname(__file__), "assets", "owl-favicon.ico"))
app.launch(
share=False,
favicon_path=os.path.join(
os.path.dirname(__file__), "assets", "owl-favicon.ico"
),
)
except Exception as e:
logging.error(f"Error occurred while starting the application: {str(e)}")
print(f"Error occurred while starting the application: {str(e)}")

View File

@ -252,7 +252,7 @@ MODULE_DESCRIPTIONS = {
"run_qwen_zh": "qwenモデルを使用して中国語タスクを処理します",
"run_azure_openai": "Azure OpenAIモデルを使用してタスクを処理します",
"run_groq": "groqモデルを使用してタスクを処理します",
"run_together_ai": "together aiモデルを使用してタスクを処理します"
"run_together_ai": "together aiモデルを使用してタスクを処理します",
}
@ -1296,7 +1296,12 @@ def main():
app = create_ui()
app.queue()
app.launch(share=False, favicon_path=os.path.join(os.path.dirname(__file__), "assets", "owl-favicon.ico"))
app.launch(
share=False,
favicon_path=os.path.join(
os.path.dirname(__file__), "assets", "owl-favicon.ico"
),
)
except Exception as e:
logging.error(f"アプリケーションの起動中にエラーが発生しました: {str(e)}")
print(f"アプリケーションの起動中にエラーが発生しました: {str(e)}")