Skip to content

Conversation

@nirtal85
Copy link
Owner

@nirtal85 nirtal85 commented Apr 7, 2025

Description

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Summary by CodeRabbit

  • Chores
    • Streamlined our automated testing process by removing redundant formatting and import organization steps.
    • Updated code quality management with a unified tool, enhancing overall efficiency in our internal checks.
    • Minor formatting adjustments in documentation and assertions for improved readability across various test files.
    • Enhanced type hinting across multiple classes for modern syntax consistency.
    • Consolidated multiline method calls and assertions into single lines for improved readability.
    • Added new dependencies for development while removing outdated ones, transitioning to a more efficient setup.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 7, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request removes code formatting and import-sorting steps from the .github/workflows/devRun.yml file’s merge_test job. The workflow now only sets up Python, creates a virtual environment, installs dependencies, runs tests, and generates reports. Additionally, the pyproject.toml file has been updated by removing the black and isort dependencies from the dev group, adding ruff with its configuration, and eliminating the previous isort settings. No public or exported entity declarations were altered.

Changes

File(s) Change Summary
.github/workflows/devRun.yml Removed steps that ran psf/black@stable and isort/isort-action@v1 in the merge_test job. Remaining steps for setting up Python, creating the virtual environment, installing dependencies, running tests, and generating reports remain unchanged.
pyproject.toml Removed black==25.1.0 and isort==6.0.1 from the dev dependency group; added ruff==0.11.4 with a new configuration (line-length of 100, target version py311, select all rules, ignore rules D203 and D213, and exclude directories .venv and env); removed the [tool.isort] configuration section.
.pre-commit-config.yaml Removed hooks: check-docstring-first, name-tests-test, file-contents-sorter, pretty-format-json, check-builtin-literals, black, autoflake, isort, pyupgrade. Added new hooks: ruff and ruff-format from ruff-pre-commit repository. Updated formatting for several hooks.
README.md Minor formatting changes to headings and command spacing.
pages/about_page.py Updated type annotations for LOGIN_LINK and REGISTER_LINK from Tuple[str, str] to tuple[str, str].
pages/base_page.py Updated type annotations for driver and several method parameters from Union[...] and Tuple[...] to modern syntax. Reformatted method documentation.
pages/forgot_password_page.py Updated type annotations for class attributes from Tuple[str, str] to tuple[str, str].
pages/login_page.py Updated type annotations for class attributes from Tuple[str, str] to tuple[str, str].
pages/project_edit_page.py Updated type annotations for class attributes from Tuple[str, str] to tuple[str, str].
pages/project_type_page.py Updated type annotations for class attributes from Tuple[str, str] to tuple[str, str].
pages/projects_page.py Updated type annotations for multiple class attributes from Tuple[str, str] to tuple[str, str]. Minor formatting changes.
pages/templates_page.py Updated type annotations for class attributes from Tuple[str, str] to tuple[str, str]. Minor formatting changes.
tests/base_test.py Updated type annotation for driver from Union[...] to `Chrome
tests/conftest.py Minor formatting adjustments and logging level updates.
tests/db_test.py Reformatted assertion statement in test_verify_population_amount method.
tests/dependency_class_test.py Modified formatting of docstrings in TestDependencyExample class.
tests/email_test.py Reformatted method call in test_verify_email_body.
tests/forgot_password_test.py Reformatted @allure.testcase decorator in test_expected_exception_on_page_title.
tests/login_test.py Reformatted assertions in test_valid_login and test_logout methods.
tests/workspaces_test.py Simplified assertions and method calls by removing unnecessary line breaks and indentation.
utilities/excel_parser.py Reformatted for loop in read_from_excel method.
utilities/mailinator_helper.py Added blank lines in docstrings for several methods.
utilities/vrt_helper.py Updated type annotations and consolidated method signatures.
utilities/web_driver_listener.py Updated type annotations for after_find and before_click methods.

Suggested reviewers

  • elias-shoursoh

Poem

I'm a rabbit hopping through the code,
Skipping old formatting on my merry road.
With a twitch of my nose and joyful "ruff" in sight,
I help the code run smooth and light.
Hop on, dear devs, our path is bright! 🐰✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 89185e4 and 719e0e3.

📒 Files selected for processing (1)
  • README.md (3 hunks)

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
pyproject.toml (1)

80-82: Test Paths Verification

The testpaths option currently specifies only the "tests" directory. Verify that this configuration correctly captures all necessary test files. If additional test directories exist or might be introduced in the future, consider updating this list.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3a085ba and 000acb0.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • .github/workflows/devRun.yml (0 hunks)
  • pyproject.toml (2 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/devRun.yml
🔇 Additional comments (2)
pyproject.toml (2)

39-43: Dependency Group Update: Transition to Ruff

The dev dependency group now includes ruff==0.11.4 and pre-commit==4.2.0, effectively replacing the previous black and isort dependencies. This change aligns with the project’s migration to using Ruff for linting and formatting. Please ensure that any related documentation and CI workflow references (such as in .github/workflows/devRun.yml) have been updated accordingly.


45-54: Ruff Configuration: Comprehensive Setup

The new [tool.ruff] configuration sets a line-length of 100, targets Python 3.11, and applies all linting rules via select = ["ALL"], while intentionally ignoring rules D203 and D213 to suit your docstring formatting preferences. Confirm that these ignored rules align with your team’s style guidelines and that this configuration meets your overall linting requirements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (15)
pages/templates_page.py (2)

13-14: Enhance constructor signature with type annotations and docstring.
The __init__ method currently lacks type annotations for its parameters (driver and wait), a return type annotation (None), and a docstring. Adding these will both satisfy linter requirements (e.g., ANN001, ANN204, D107) and improve code clarity.
Example diff suggestion:

-def __init__(self, driver, wait):
-    super().__init__(driver, wait)
+def __init__(self, driver: WebDriver, wait: WebDriverWait) -> None:
+    """
+    Initialize the TemplatesPage with a Selenium WebDriver and a wait object.
+    """
+    super().__init__(driver, wait)

(Ensure to import WebDriver and WebDriverWait from selenium as needed.)

🧰 Tools
🪛 Ruff (0.8.2)

13-13: Missing return type annotation for special method __init__

Add return type annotation: None

(ANN204)


13-13: Missing docstring in __init__

(D107)


13-13: Missing type annotation for function argument driver

(ANN001)


13-13: Missing type annotation for function argument wait

(ANN001)


16-16: Add a docstring to the public method choose_template.
Providing a brief description for this method will clarify its purpose for other developers and satisfy linter warning (D102).
Example:

-def choose_template(self, template_name: str) -> None:
+def choose_template(self, template_name: str) -> None:
+    """
+    Select the template that contains the given template name.
+    """
🧰 Tools
🪛 Ruff (0.8.2)

16-16: Missing docstring in public method

(D102)

pages/projects_page.py (3)

149-149: Document the purpose of get_workspaces_number.
This public method currently lacks a docstring. Consider adding one to describe its functionality (i.e., returning the count of workspace elements found).
Example diff:

-def get_workspaces_number(self) -> int:
+def get_workspaces_number(self) -> int:
+    """
+    Retrieve the number of workspaces displayed.
+    """
🧰 Tools
🪛 Ruff (0.8.2)

149-149: Missing docstring in public method

(D102)


166-166: Include documentation for get_projects_number_from_workspace.
Adding a docstring here will improve clarity and satisfy linter hint (D102).
Example:

-def get_projects_number_from_workspace(self) -> int:
+def get_projects_number_from_workspace(self) -> int:
+    """
+    Get the number of projects displayed next to the main workspace name.
+    """
🧰 Tools
🪛 Ruff (0.8.2)

166-166: Missing docstring in public method

(D102)


174-174: Add a docstring for is_workspace_found.
A brief description of this method’s behavior would be beneficial.
Example:

-def is_workspace_found(self, workspace_name: str) -> bool:
+def is_workspace_found(self, workspace_name: str) -> bool:
+    """
+    Check if a workspace with the given name exists.
+    """
🧰 Tools
🪛 Ruff (0.8.2)

174-174: Missing docstring in public method

(D102)

tests/dependency_class_test.py (1)

13-17: Add return type annotation and fix line length.

Consider addressing the static analysis issues:

-    def test_e(self):
+    def test_e(self) -> None:

And split the long line to meet the line length limit:

-        """Placeholder test function with the dependency name "e" and depends on "TestDependencyExample::b".
+        """Placeholder test function with the dependency name "e" and depends on 
+        "TestDependencyExample::b".
🧰 Tools
🪛 Ruff (0.8.2)

13-13: Missing return type annotation for public function test_e

Add return type annotation: None

(ANN201)


14-14: Line too long (108 > 100)

(E501)

utilities/web_driver_listener.py (1)

10-21: Consider adding docstrings to public methods.

The static analyzer detected missing docstrings in the public methods. While not critical, adding them would improve code documentation.

    def after_find(self, by: By, value: str, driver: Chrome | Firefox | Edge) -> None:
+        """Highlight found elements with a red border.
+        
+        :param by: The locator strategy
+        :param value: The locator value
+        :param driver: The WebDriver instance
+        """
        webelements: list[WebElement] = driver.find_elements(by=by, value=value)
        for element in webelements:
            if element.is_displayed():
                driver.execute_script(
                    "arguments[0].setAttribute('style', 'border: 2px solid red;');",
                    element,
                )

    def before_click(self, element: WebElement, driver: Chrome | Firefox | Edge) -> None:
+        """Wait for element to be clickable before clicking.
+        
+        :param element: The WebElement to be clicked
+        :param driver: The WebDriver instance
+        """
        wait = WebDriverWait(driver, 10)
        wait.until(expected_conditions.element_to_be_clickable(element))
🧰 Tools
🪛 Ruff (0.8.2)

10-10: Missing docstring in public method

(D102)


19-19: Missing docstring in public method

(D102)

tests/workspaces_test.py (2)

39-39: Add return type annotation and docstring

According to the static analysis hints, this method is missing a return type annotation and docstring.

-    def test_rename_workspace(self, data: Data):
+    def test_rename_workspace(self, data: Data) -> None:
+        """Test renaming an existing workspace."""
🧰 Tools
🪛 Ruff (0.8.2)

39-39: Missing return type annotation for public function test_rename_workspace

Add return type annotation: None

(ANN201)


39-39: Missing docstring in public method

(D102)


85-85: Add return type annotation and docstring

According to the static analysis hints, this method is missing a return type annotation and docstring.

-    def test_search_project(self, data: Data):
+    def test_search_project(self, data: Data) -> None:
+        """Test searching for an existing project."""
🧰 Tools
🪛 Ruff (0.8.2)

85-85: Missing return type annotation for public function test_search_project

Add return type annotation: None

(ANN201)


85-85: Missing docstring in public method

(D102)

.pre-commit-config.yaml (1)

31-38: Great addition of Ruff for linting and formatting!

Adding Ruff as a replacement for multiple individual linting and formatting tools is an excellent choice that will simplify your workflow. However, I notice both hooks have continue_on_error: true which means linting and formatting errors won't cause pre-commit to fail. This might allow issues to slip through.

Consider if this is intentional or if you'd prefer to fail on errors at least for the linting step:

  - id: ruff
    args: [ --fix ]
-   continue_on_error: true
pages/base_page.py (5)

13-13: Good modernization of type annotations

The updated syntax for union types (using the pipe | operator) aligns with Python 3.10+ standards. Consider adding a return type annotation as suggested by static analysis:

-    def __init__(self, driver: Chrome | Firefox | Edge, wait: WebDriverWait):
+    def __init__(self, driver: Chrome | Firefox | Edge, wait: WebDriverWait) -> None:
🧰 Tools
🪛 Ruff (0.8.2)

13-13: Missing return type annotation for special method __init__

Add return type annotation: None

(ANN204)


13-13: Missing docstring in __init__

(D107)


58-61: Missing docstring in public method

Consider adding a docstring to the click method to improve code documentation:

def click(self, locator: tuple[str, str]) -> None:
+    """Click on an element identified by the given locator.
+    
+    Parameters
+    ----------
+    locator : tuple[str, str]
+        A tuple containing the locator strategy and locator value.
+    """
    el: WebElement = self.wait.until(expected_conditions.element_to_be_clickable(locator))
    self._highlight_element(el, "green")
    el.click()
🧰 Tools
🪛 Ruff (0.8.2)

58-58: Missing docstring in public method

(D102)


63-68: Missing docstring in public method

Consider adding a docstring to the fill_text method to improve code documentation:

def fill_text(self, locator: tuple[str, str], txt: str) -> None:
+    """Fill text into an element identified by the given locator.
+    
+    Parameters
+    ----------
+    locator : tuple[str, str]
+        A tuple containing the locator strategy and locator value.
+    txt : str
+        The text to enter into the element.
+    """
    el: WebElement = self.wait.until(expected_conditions.element_to_be_clickable(locator))
    el.clear()
    self._highlight_element(el, "green")
    el.send_keys(txt)
🧰 Tools
🪛 Ruff (0.8.2)

63-63: Missing docstring in public method

(D102)


69-72: Missing docstring in public method

Consider adding a docstring to the clear_text method to improve code documentation:

def clear_text(self, locator: tuple[str, str]) -> None:
+    """Clear text from an element identified by the given locator.
+    
+    Parameters
+    ----------
+    locator : tuple[str, str]
+        A tuple containing the locator strategy and locator value.
+    """
    el: WebElement = self.wait.until(expected_conditions.element_to_be_clickable(locator))
    el.clear()
🧰 Tools
🪛 Ruff (0.8.2)

69-69: Missing docstring in public method

(D102)


80-84: Missing docstring in public method

Consider adding a docstring to the get_text method to improve code documentation:

def get_text(self, locator: tuple[str, str]) -> str:
+    """Get text from an element identified by the given locator.
+    
+    Parameters
+    ----------
+    locator : tuple[str, str]
+        A tuple containing the locator strategy and locator value.
+        
+    Returns
+    -------
+    str
+        The text content of the element.
+    """
    el: WebElement = self.wait.until(expected_conditions.visibility_of_element_located(locator))
    self._highlight_element(el, "green")
    return el.text
🧰 Tools
🪛 Ruff (0.8.2)

80-80: Missing docstring in public method

(D102)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 000acb0 and 025b4c1.

📒 Files selected for processing (23)
  • .pre-commit-config.yaml (3 hunks)
  • README.md (2 hunks)
  • pages/about_page.py (1 hunks)
  • pages/base_page.py (3 hunks)
  • pages/forgot_password_page.py (1 hunks)
  • pages/login_page.py (1 hunks)
  • pages/project_edit_page.py (1 hunks)
  • pages/project_type_page.py (1 hunks)
  • pages/projects_page.py (7 hunks)
  • pages/templates_page.py (1 hunks)
  • pyproject.toml (2 hunks)
  • tests/base_test.py (1 hunks)
  • tests/conftest.py (9 hunks)
  • tests/db_test.py (1 hunks)
  • tests/dependency_class_test.py (1 hunks)
  • tests/email_test.py (1 hunks)
  • tests/forgot_password_test.py (1 hunks)
  • tests/login_test.py (3 hunks)
  • tests/workspaces_test.py (5 hunks)
  • utilities/excel_parser.py (1 hunks)
  • utilities/mailinator_helper.py (5 hunks)
  • utilities/vrt_helper.py (4 hunks)
  • utilities/web_driver_listener.py (1 hunks)
✅ Files skipped from review due to trivial changes (11)
  • tests/db_test.py
  • README.md
  • pages/about_page.py
  • tests/forgot_password_test.py
  • utilities/mailinator_helper.py
  • pages/project_type_page.py
  • tests/login_test.py
  • tests/conftest.py
  • pages/project_edit_page.py
  • pages/forgot_password_page.py
  • pages/login_page.py
🧰 Additional context used
🧬 Code Definitions (2)
tests/email_test.py (2)
tests/conftest.py (1)
  • mailinator_helper (98-102)
utilities/mailinator_helper.py (1)
  • get_message (80-104)
tests/workspaces_test.py (3)
utilities/data.py (1)
  • Data (33-36)
pages/projects_page.py (5)
  • rename_workspace (95-116)
  • is_workspace_found (174-179)
  • get_projects_number_from_workspace (166-171)
  • delete_project (131-146)
  • get_projects_number_in_page (159-163)
enums/status.py (1)
  • Status (4-6)
🪛 Ruff (0.8.2)
utilities/vrt_helper.py

60-60: Missing return type annotation for public function shoot_page_ang_ignore_elements

Add return type annotation: None

(ANN201)


98-98: Missing return type annotation for public function shoot_element

Add return type annotation: None

(ANN201)

utilities/web_driver_listener.py

10-10: Missing docstring in public method

(D102)


19-19: Missing docstring in public method

(D102)

pages/base_page.py

13-13: Missing return type annotation for special method __init__

Add return type annotation: None

(ANN204)


13-13: Missing docstring in __init__

(D107)


49-49: Line too long (103 > 100)

(E501)


58-58: Missing docstring in public method

(D102)


63-63: Missing docstring in public method

(D102)


69-69: Missing docstring in public method

(D102)


80-80: Missing docstring in public method

(D102)

pages/projects_page.py

149-149: Missing docstring in public method

(D102)


166-166: Missing docstring in public method

(D102)


174-174: Missing docstring in public method

(D102)

pages/templates_page.py

13-13: Missing return type annotation for special method __init__

Add return type annotation: None

(ANN204)


13-13: Missing docstring in __init__

(D107)


13-13: Missing type annotation for function argument driver

(ANN001)


13-13: Missing type annotation for function argument wait

(ANN001)


16-16: Missing docstring in public method

(D102)

tests/dependency_class_test.py

13-13: Missing return type annotation for public function test_e

Add return type annotation: None

(ANN201)


14-14: Line too long (108 > 100)

(E501)

tests/workspaces_test.py

39-39: Missing return type annotation for public function test_rename_workspace

Add return type annotation: None

(ANN201)


39-39: Missing docstring in public method

(D102)


85-85: Missing return type annotation for public function test_search_project

Add return type annotation: None

(ANN201)


85-85: Missing docstring in public method

(D102)

🔇 Additional comments (22)
pages/templates_page.py (1)

10-11: Modernized type annotations for UI selectors.
The conversion from Tuple[str, str] to the built-in tuple[str, str] is appropriate and aligns with modern Python type hinting.

pages/projects_page.py (1)

12-64: Consistent type annotation modernization for UI selectors.
All UI element selector attributes have been updated from using Tuple[str, str] to the built-in tuple[str, str], which is a clear and modern approach since Python 3.9. The changes enhance code readability and consistency.

tests/dependency_class_test.py (1)

9-11: LGTM! Docstring formatting looks good.

The reformatted docstring improves code consistency.

🧰 Tools
🪛 Ruff (0.8.2)

9-11: 1 blank line required between summary line and description

(D205)

utilities/excel_parser.py (1)

20-20: LGTM! Single-line formatting is good.

The reformatted line improves readability while maintaining functionality.

utilities/web_driver_listener.py (2)

10-11: LGTM! Nice type annotation updates.

The modernized type annotations using the pipe operator for union types and built-in generics improves code quality.

🧰 Tools
🪛 Ruff (0.8.2)

10-10: Missing docstring in public method

(D102)


19-19: LGTM! Improved type annotation.

The update to modern union type syntax is consistent with other changes.

🧰 Tools
🪛 Ruff (0.8.2)

19-19: Missing docstring in public method

(D102)

utilities/vrt_helper.py (2)

11-11: LGTM! Clean import formatting.

The consolidated import line improves readability.


29-29: LGTM! Updated type annotation.

The modernized type annotation using the pipe operator for union types improves code quality.

tests/email_test.py (1)

18-18: Formatting improvement looks good

The function call has been properly formatted to a single line, improving readability while maintaining the same functionality.

tests/base_test.py (1)

18-18: Type annotation modernization is appropriate

The type annotation has been updated from Union[Chrome, Firefox, Edge] to Chrome | Firefox | Edge, using the newer Python 3.10+ syntax for union types. This is a good modernization without changing functionality.

tests/workspaces_test.py (8)

34-34: Formatting improvement looks good

The assertion has been properly formatted to a single line, improving readability.


40-43: Method call and assertion formatting looks good

The method call and assertion have been reformatted to be more readable with appropriate line breaks.


61-61: Formatting improvement looks good

The method call has been properly formatted to a single line, improving readability.


80-80: Formatting improvement looks good

The assertion has been properly formatted to a single line, improving readability.


87-87: Formatting improvement looks good

The variable assignment has been properly formatted to a single line, improving readability.


104-104: Formatting improvement looks good

The method call has been properly formatted to a single line, improving readability.


106-106: Formatting improvement looks good

The assertion has been properly formatted to a single line, improving readability.


117-119: Formatting improvement looks good

The assertion has been properly formatted with appropriate line breaks, improving readability.

pyproject.toml (3)

5-9: Ruff migration looks good

The replacement of black and isort with ruff in the dev dependencies is a good modernization. Ruff combines multiple linting and formatting tools into one, improving tooling efficiency.


74-83: Ruff configuration looks appropriate

The Ruff configuration includes common best practices:

  • Setting appropriate line length
  • Targeting Python 3.11
  • Selecting all linting rules with specific ignores for conflicting rules

This comprehensive setup will help maintain code quality.


85-87: Ruff formatting configuration looks good

The formatting configuration with double quotes and proper docstring code formatting follows common Python standards.

pages/base_page.py (1)

38-45: Docstring format improvement

Good update to the docstring format using the NumPy style with section headers and separator lines. This format is more maintainable and consistent.

def shoot_page_ang_ignore_elements(
self, baseline_name: str, elements: list[WebElement]
):
def shoot_page_ang_ignore_elements(self, baseline_name: str, elements: list[WebElement]):
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add return type annotation and fix method name.

The method signature has been reformatted well, but it's missing a return type annotation according to static analysis.

-    def shoot_page_ang_ignore_elements(self, baseline_name: str, elements: list[WebElement]):
+    def shoot_page_ang_ignore_elements(self, baseline_name: str, elements: list[WebElement]) -> None:

Also, there appears to be a typo in the method name ("ang" should be "and"), but this may be addressed in a separate PR.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
def shoot_page_ang_ignore_elements(self, baseline_name: str, elements: list[WebElement]):
def shoot_page_ang_ignore_elements(self, baseline_name: str, elements: list[WebElement]) -> None:
🧰 Tools
🪛 Ruff (0.8.2)

60-60: Missing return type annotation for public function shoot_page_ang_ignore_elements

Add return type annotation: None

(ANN201)

@github-actions github-actions bot requested a review from elias-shoursoh April 7, 2025 06:45
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (1)
pages/projects_page.py (1)

193-193: Logic fix in is_project_found method properly implemented.

The method now correctly uses any() instead of all() to check if any project title matches the requested name, not all of them. This aligns with the expected behavior and is consistent with the similar is_workspace_found method.

🧹 Nitpick comments (2)
pages/projects_page.py (2)

101-101: Consider simplifying the any() check.

The current implementation works but could be simplified for better readability.

-flag = any(old_name in workspaces_text_list[i] for i in range(len(workspaces_text_list)))
+flag = old_name in workspaces_text_list

149-149: Add docstrings to public methods.

The static analysis tool has identified missing docstrings for these public methods. Adding docstrings would improve code documentation and meet the project's style guidelines.

Example for get_workspaces_number:

@allure.step("Get workspaces number")
def get_workspaces_number(self) -> int:
    """Return the total number of workspaces available to the user."""
    # existing implementation...

Similar docstrings should be added to get_projects_number_from_workspace and is_workspace_found.

Also applies to: 166-166, 174-174

🧰 Tools
🪛 Ruff (0.8.2)

149-149: Missing docstring in public method

(D102)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 025b4c1 and fbdd6da.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • pages/projects_page.py (7 hunks)
🧰 Additional context used
🪛 Ruff (0.8.2)
pages/projects_page.py

149-149: Missing docstring in public method

(D102)


166-166: Missing docstring in public method

(D102)


174-174: Missing docstring in public method

(D102)

🔇 Additional comments (1)
pages/projects_page.py (1)

12-63: Type annotation modernization looks good.

The change from Tuple[str, str] to tuple[str, str] for class attributes follows PEP 585, which allows using built-in collection types as generic types instead of their capitalized counterparts from the typing module. This change aligns with modern Python typing practices (Python 3.9+).

@nirtal85 nirtal85 merged commit f09ae3b into main Apr 7, 2025
2 checks passed
@nirtal85 nirtal85 deleted the fix-ruff-lock branch April 7, 2025 06:57
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.

2 participants