Skip to content

Conversation

@sandeepsuryaprasad
Copy link
Contributor

@sandeepsuryaprasad sandeepsuryaprasad commented Jul 12, 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 settings from tox.ini file to pyproject.toml

Motivation and Context

  • isort and black settings can now be configured in pyproject.toml (PEP 621)
  • by moving linter settings to pyproject.toml all other config files could be avoided (tox.ini, setup.cfg, mypy.ini, pytest.ini)

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 settings from tox.ini to pyproject.toml.
  • Configured isort to use the "black" profile in pyproject.toml.
  • Set Python version to 3.8 and enforced single-line imports in pyproject.toml.

Changes walkthrough 📝

Relevant files
Configuration changes
pyproject.toml
Add isort configuration to pyproject.toml                               

py/pyproject.toml

  • Added isort settings to pyproject.toml.
  • Configured isort to use the "black" profile.
  • Set Python version to 3.8 and enforced single-line imports.
  • +9/-0     
    tox.ini
    Remove isort configuration from tox.ini                                   

    py/tox.ini

    • Removed isort settings from tox.ini.
    +0/-11   

    💡 PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    @qodo-merge-pro
    Copy link
    Contributor

    PR Reviewer Guide 🔍

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ No key issues to review

    @qodo-merge-pro
    Copy link
    Contributor

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Possible bug
    Ensure boolean values are correctly capitalized to match Python's syntax

    Ensure consistency in boolean values by using the same case. Python recognizes True
    and False as boolean values, not true or false. This will prevent potential bugs or
    misinterpretations of the configuration.

    py/pyproject.toml [12]

    -force_single_line = true
    +force_single_line = True
     
    • Apply this suggestion
    Suggestion importance[1-10]: 10

    Why: This suggestion corrects a potential bug by ensuring the boolean value is properly capitalized, which is crucial for correct interpretation by Python.

    10
    Maintainability
    Improve readability and consistency by formatting key-value assignments uniformly

    Use a consistent style for key-value assignments in the TOML file. The py_version
    key should have a space before and after the equals sign to match the style of other
    keys.

    py/pyproject.toml [11]

    -py_version=38
    +py_version = 38
     
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: This suggestion improves the readability and maintainability of the configuration file by ensuring consistent formatting.

    8
    Best practice
    Facilitate easier future modifications and cleaner version control diffs by adding a trailing comma

    Add a trailing comma after the last item in the section to facilitate easier future
    modifications and version control diffs.

    py/pyproject.toml [12]

    -force_single_line = true
    +force_single_line = True,
     
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: Adding a trailing comma is a good practice for future modifications and version control, although it is not critical.

    7
    Enhancement
    Update the Python version to take advantage of newer features and improvements

    Consider specifying a more recent Python version if the project supports it, as
    Python 3.8 will reach end-of-life in October 2024. This can help leverage newer
    language features and improvements.

    py/pyproject.toml [11]

    -py_version = 38
    +py_version = 310
     
    • Apply this suggestion
    Suggestion importance[1-10]: 6

    Why: While updating to a newer Python version can be beneficial, it may require additional testing and validation to ensure compatibility.

    6

    @sandeepsuryaprasad sandeepsuryaprasad changed the title [py] moved isort settings from tox.ini file to pyproject.toml [py] moved isort, black and docformatter settings from tox.ini file to pyproject.toml Jul 20, 2024
    @sandeepsuryaprasad
    Copy link
    Contributor Author

    @AutomatedTester @diemol can someone please review this PR.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Labels

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    1 participant