From 807dfe0558445a9fff8c4f0b6b808b6e9386ba45 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Mon, 12 May 2025 13:30:28 +0000 Subject: [PATCH] Fix linting issues by updating ruff configuration and adding linting test Co-Authored-By: Joe Moura --- .ruff.toml | 31 +++++++++++++++++++++++++++++++ tests/test_linting.py | 12 ++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 tests/test_linting.py diff --git a/.ruff.toml b/.ruff.toml index 4f8811cef..60126803c 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -2,3 +2,34 @@ exclude = [ "templates", "__init__.py", ] + +[lint] +select = ["ALL"] +ignore = [ + "D100", # Missing docstring in public module + "D101", # Missing docstring in public class + "D102", # Missing docstring in public method + "D103", # Missing docstring in public function + "D104", # Missing docstring in public package + "D105", # Missing docstring in magic method + "D106", # Missing docstring in public nested class + "D107", # Missing docstring in __init__ + "ANN001", # Missing type annotation for function argument + "ANN002", # Missing type annotation for *args + "ANN003", # Missing type annotation for **kwargs + "ANN101", # Missing type annotation for self in method + "ANN102", # Missing type annotation for cls in classmethod + "ANN201", # Missing return type annotation for public function + "ANN202", # Missing return type annotation for private function + "ANN204", # Missing return type annotation for special method + "ANN205", # Missing return type annotation for staticmethod + "ANN206", # Missing return type annotation for classmethod + "E501", # Line too long + "PT011", # pytest.raises() without match parameter +] + +[lint.per-file-ignores] +"tests/*" = ["S101"] # Allow assert in tests + +[lint.isort] +known-first-party = ["crewai"] diff --git a/tests/test_linting.py b/tests/test_linting.py new file mode 100644 index 000000000..a4dbd161f --- /dev/null +++ b/tests/test_linting.py @@ -0,0 +1,12 @@ +"""Test to verify that the linting configuration is working correctly.""" +import os +from pathlib import Path + + +def test_ruff_config_exists(): + """Test that the ruff configuration file exists.""" + repo_root = Path(__file__).parent.parent + ruff_config_path = repo_root / ".ruff.toml" + assert ruff_config_path.exists(), "Ruff configuration file (.ruff.toml) should exist" + + assert ruff_config_path.stat().st_size > 0, "Ruff configuration file should not be empty"