Skip to content

chore: Auto-fix formatting and linting errors with Ruff#19

Merged
DsThakurRawat merged 1 commit into
mainfrom
auto-lint-fixes
Jun 2, 2026
Merged

chore: Auto-fix formatting and linting errors with Ruff#19
DsThakurRawat merged 1 commit into
mainfrom
auto-lint-fixes

Conversation

@DsThakurRawat
Copy link
Copy Markdown
Owner

No description provided.

@DsThakurRawat DsThakurRawat merged commit bb685c4 into main Jun 2, 2026
1 check passed
@DsThakurRawat DsThakurRawat deleted the auto-lint-fixes branch June 2, 2026 15:51
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 2, 2026

Warning

Review limit reached

@DsThakurRawat, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 51 minutes and 2 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 23fc4802-1699-4bfa-81f0-ea3d3e8df686

📥 Commits

Reviewing files that changed from the base of the PR and between cb390fd and 2ed3486.

📒 Files selected for processing (80)
  • argus/agents/agent_models.py
  • argus/agents/enhanced_adapter.py
  • argus/agents/legacy_adapter.py
  • argus/agents/response_models.py
  • argus/config/ingestion_config.py
  • argus/core/exceptions/__init__.py
  • argus/core/interfaces/base.py
  • argus/core/interfaces/protocols.py
  • argus/core/logging/manager.py
  • argus/core/logging/metrics.py
  • argus/core/performance/profiler.py
  • argus/core/quality/cli.py
  • argus/core/quality/exceptions.py
  • argus/core/quality/reports.py
  • argus/core/quality/validators.py
  • argus/core/resilience/bulkhead_isolator.py
  • argus/core/resilience/health_checker.py
  • argus/core/resilience/rate_limiter.py
  • argus/core/resilience/retry_handler.py
  • argus/core/resilience/timeout_manager.py
  • argus/ingestion/interfaces/resilience.py
  • argus/ingestion/manager/log_manager.py
  • argus/llm/base.py
  • argus/llm/capabilities/discovery.py
  • argus/llm/capabilities/testing.py
  • argus/llm/config.py
  • argus/llm/config_loaders.py
  • argus/llm/config_manager.py
  • argus/llm/enhanced_service.py
  • argus/llm/factory.py
  • argus/llm/mirascope_response.py
  • argus/llm/provider_framework/base_template.py
  • argus/llm/providers/groq_provider.py
  • argus/llm/providers/litellm_provider.py
  • argus/llm/providers/ollama_provider.py
  • argus/llm/service_base.py
  • argus/llm/service_manager.py
  • argus/llm/strategy_manager.py
  • argus/metrics/alerting.py
  • argus/ml/code_analysis_models.py
  • argus/ml/code_context_extractor.py
  • argus/ml/drift_detector.py
  • argus/ml/gemini_pattern_classifier.py
  • argus/ml/log_quality_validator.py
  • argus/ml/model_performance_monitor.py
  • argus/ml/performance_config.py
  • argus/ml/prompt_utils.py
  • argus/ml/validation_config.py
  • argus/ml/workflow/workflow_analysis.py
  • argus/ml/workflow/workflow_generation.py
  • argus/ml/workflow/workflow_metrics.py
  • argus/ml/workflow/workflow_validation.py
  • argus/source_control/base.py
  • argus/source_control/base_implementation.py
  • argus/source_control/configured_provider.py
  • argus/source_control/enhanced_base_implementation.py
  • argus/source_control/error_handling/factory.py
  • argus/source_control/health_checks.py
  • argus/source_control/monitoring.py
  • argus/source_control/providers/github/enhanced_github_provider.py
  • argus/source_control/providers/github/github_provider.py
  • argus/source_control/providers/gitlab/enhanced_gitlab_provider.py
  • argus/source_control/providers/gitlab/gitlab_provider.py
  • argus/source_control/providers/local/enhanced_local_provider.py
  • argus/source_control/providers/local/local_provider.py
  • tests/ingestion/adapters/test_aws_cloudwatch.py
  • tests/ingestion_config/simple_config_test.py
  • tests/ingestion_config/test_config_system.py
  • tests/llm/test_factory_core.py
  • tests/llm/test_provider_interface.py
  • tests/llm/test_service.py
  • tests/source_control/test_base_sub_operation.py
  • tests/source_control/test_github_provider.py
  • tests/source_control/test_repository_access_security.py
  • tests/source_control/test_repository_permission_tests.py
  • tests/source_control/test_setup.py
  • tests/templates/test_core_template.py
  • tests/test_base_prompt_template.py
  • tests/test_capability_integration.py
  • tests/test_enhanced_analysis_agent.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch auto-lint-fixes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request focuses on modernizing type annotations (using | instead of Optional/Union and lowercase collections like list and dict), cleaning up unused imports, formatting code, and simplifying nested context managers. The review feedback highlights a critical issue in tests/llm/test_service.py where a pytest.raises block contains only pass and does not actually trigger the expected ImportError. Additionally, the reviewer recommends specifying an explicit encoding="utf-8" when opening text files to avoid platform-dependent encoding issues, and using the built-in callable() function instead of checking hasattr(..., "__call__") for more idiomatic Python code.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread tests/llm/test_service.py
Comment on lines 235 to +240
with patch.dict(
"sys.modules", {"instructor": None, "litellm": None, "mirascope": None}
), pytest.raises(
ImportError, match="Required dependencies not installed"
):
with pytest.raises(
ImportError, match="Required dependencies not installed"
):
pass
pass
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The pytest.raises block only contains pass, which means no exception will actually be raised during the test execution, causing the test to fail with Failed: DID NOT RAISE <class 'ImportError'>. You should trigger the actual import or function call that is expected to raise the ImportError inside the context manager.

Suggested change
with patch.dict(
"sys.modules", {"instructor": None, "litellm": None, "mirascope": None}
), pytest.raises(
ImportError, match="Required dependencies not installed"
):
with pytest.raises(
ImportError, match="Required dependencies not installed"
):
pass
pass
with patch.dict(
"sys.modules", {"instructor": None, "litellm": None, "mirascope": None}
), pytest.raises(
ImportError, match="Required dependencies not installed"
):
import argus.llm.enhanced_service


try:
with open(self.config_path, "r") as f:
with open(self.config_path) as f:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

When opening text files, it is highly recommended to specify an explicit encoding (such as encoding="utf-8") to prevent platform-dependent encoding issues, especially when running on systems with different default locales (like Windows).

Suggested change
with open(self.config_path) as f:
with open(self.config_path, encoding="utf-8") as f:

)

with open(self.file_path, "r") as f:
with open(self.file_path) as f:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

When opening text files, it is highly recommended to specify an explicit encoding (such as encoding="utf-8") to prevent platform-dependent encoding issues, especially when running on systems with different default locales (like Windows).

Suggested change
with open(self.file_path) as f:
with open(self.file_path, encoding="utf-8") as f:

"""Load configuration from a file (YAML or JSON)."""
try:
with open(path, "r") as f:
with open(path) as f:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

When opening text files, it is highly recommended to specify an explicit encoding (such as encoding="utf-8") to prevent platform-dependent encoding issues, especially when running on systems with different default locales (like Windows).

Suggested change
with open(path) as f:
with open(path, encoding="utf-8") as f:

try:
# Try calling as async first
if hasattr(capability_method, '__call__'):
if hasattr(capability_method, "__call__"):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using the built-in callable() function is more idiomatic, robust, and performant in Python than checking hasattr(..., "__call__").

Suggested change
if hasattr(capability_method, "__call__"):
if callable(capability_method):

DsThakurRawat added a commit that referenced this pull request Jun 3, 2026
chore: Auto-fix formatting and linting errors with Ruff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant