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

[py] moved isort, black and docformatter settings from tox.ini file to pyproject.toml #14671

Merged
merged 4 commits into from
Oct 29, 2024

Conversation

sandeepsuryaprasad
Copy link
Contributor

@sandeepsuryaprasad sandeepsuryaprasad commented Oct 29, 2024

User description

Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Description

Moved isort and black settings from tox.ini file to pyproject.toml.

Motivation and Context

isort and black settings can now be configured in pyproject.toml (PEP 621)

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 change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

PR Type

enhancement, configuration changes


Description

  • Moved isort, black, and docformatter settings from tox.ini and setup.cfg to pyproject.toml.
  • Added configuration for isort, black, and docformatter in pyproject.toml.
  • Removed redundant pytest settings from setup.cfg as all pytest settings are now configured in pyproject.toml.

PRDescriptionHeader.CHANGES_WALKTHROUGH

Relevant files
Configuration changes
pyproject.toml
Add isort, black, and docformatter configurations               

py/pyproject.toml

  • Added isort configuration with profile set to black.
  • Added black configuration with line length and target version.
  • Added docformatter configuration with recursive option.
  • +16/-0   
    setup.cfg
    Remove redundant pytest settings                                                 

    py/setup.cfg

    • Removed redundant pytest settings.
    +0/-5     
    tox.ini
    Remove isort configuration                                                             

    py/tox.ini

    • Removed isort configuration.
    +0/-11   

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Configuration Consistency
    Ensure that the moved configuration settings for isort, black, and docformatter in pyproject.toml are consistent with the previous settings in tox.ini and setup.cfg.

    Removed Configuration
    Verify if the removed pytest configuration from setup.cfg is intentional and if it's been moved to an appropriate location or if it's no longer needed.

    Copy link
    Contributor

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Enhancement
    Align isort configuration with black to ensure consistent formatting

    Add a line-length configuration to the [tool.isort] section to ensure it matches the
    line-length setting in the [tool.black] section. This will help maintain consistency
    between isort and black formatting.

    py/pyproject.toml [65-72]

     [tool.isort]
     # isort is a common python tool for keeping imports nicely formatted.
     # Automatically keep imports alphabetically sorted, on single lines in
     # PEP recommended sections (https://peps.python.org/pep-0008/#imports)
     # files or individual lines can be ignored via `# isort:skip|# isort:skip_file`.
     profile = "black"
    -py_version=38
    +py_version = 38
     force_single_line = true
    +line_length = 120
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: Adding a line-length configuration to the [tool.isort] section to match the [tool.black] section is a valid enhancement. It ensures consistency between the two tools, which can help maintain uniform formatting across the project.

    7
    Enhance docformatter configuration for more consistent documentation formatting

    Consider adding more configuration options to the [tool.docformatter] section, such
    as wrap-summaries, wrap-descriptions, and make-summary-multi-line, to ensure
    consistent documentation formatting across the project.

    py/pyproject.toml [78-79]

     [tool.docformatter]
     recursive = true
    +wrap-summaries = 120
    +wrap-descriptions = 120
    +make-summary-multi-line = true
    • Apply this suggestion
    Suggestion importance[1-10]: 6

    Why: The suggestion to add additional configuration options to the [tool.docformatter] section is a reasonable enhancement. It can improve documentation formatting consistency, although it is not critical to the current PR changes.

    6

    💡 Need additional feedback ? start a PR chat

    @VietND96 VietND96 added the C-py label Oct 29, 2024
    py/setup.cfg Show resolved Hide resolved
    @VietND96 VietND96 merged commit 8e95ea9 into SeleniumHQ:trunk Oct 29, 2024
    13 checks passed
    @VietND96
    Copy link
    Member

    Thank you, @sandeepsuryaprasad !

    @sandeepsuryaprasad sandeepsuryaprasad deleted the isort branch November 24, 2024 04:14
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants