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

feat: use ruff #275

Merged
merged 1 commit into from
Feb 27, 2024
Merged

feat: use ruff #275

merged 1 commit into from
Feb 27, 2024

Conversation

BoboTiG
Copy link
Owner

@BoboTiG BoboTiG commented Feb 26, 2024

No description provided.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

PR Type: Refactoring

PR Summary: The pull request introduces several changes aimed at modernizing the codebase and improving readability. It includes the use of Python's future annotations for type hinting, adopting a more consistent documentation style across different modules, and refining the structure of various classes and methods. Additionally, the PR incorporates error handling improvements by refactoring error messages into separate variables before raising exceptions. These changes are spread across multiple files within the project, including core modules and test suites.

Decision: Comment

📝 Type: 'Refactoring' - not supported yet.
  • Sourcery currently only approves 'Typo fix' PRs.
✅ Issue addressed: this change correctly addresses the issue or implements the desired feature.
No details provided.
📝 Complexity: the changes are too large or complex for Sourcery to approve.
  • Unsupported files: the diff contains files that Sourcery does not currently support during reviews.
  • Big diff: the diff is too large to approve with confidence.

General suggestions:

  • Consider verifying the consistency of documentation across the entire codebase to match the newly adopted style for improved readability.
  • Review the use of type hinting across all modules to ensure it aligns with the changes introduced in this PR, leveraging Python's future annotations where applicable.
  • Evaluate the error handling strategy across the project to ensure that error messages are consistently managed and provide clear, actionable information to the users.

Thanks for using Sourcery. We offer it for free for open source projects and would be very grateful if you could help us grow. If you like it, would you consider sharing Sourcery on your favourite social media? ✨

Share Sourcery

Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

master_doc = "index"

# General information about the project.
project = "Python MSS"
copyright = f"{__date__}, {__author__} & contributors"
author = "Tiger-222"
copyright = f"{mss.__date__}, {mss.__author__} & contributors" # noqa:A001
Copy link

Choose a reason for hiding this comment

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

issue (rule): Sourcery has identified the following issue:


ExplanationPython has a number of builtin variables: functions and constants that
form a part of the language, such as list, getattr, and type
(See https://docs.python.org/3/library/functions.html).
It is valid, in the language, to re-bind such variables:

list = [1, 2, 3]

However, this is considered poor practice.

  • It will confuse other developers.
  • It will confuse syntax highlighters and linters.
  • It means you can no longer use that builtin for its original purpose.

How can you solve this?

Rename the variable something more specific, such as integers.
In a pinch, my_list and similar names are colloquially-recognized
placeholders.

with pytest.raises(ScreenShotError):
mss.mss()
monkeypatch.undo()

with mss.mss() as sct:
assert isinstance(sct, mss.darwin.MSS) # For Mypy
Copy link

Choose a reason for hiding this comment

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

issue (rule): Sourcery has identified the following issue:

@BoboTiG BoboTiG force-pushed the feat-ruff branch 6 times, most recently from dd7e10d to 8a1ec3b Compare February 26, 2024 20:39
@BoboTiG BoboTiG merged commit 20a24c5 into main Feb 27, 2024
20 checks passed
@BoboTiG BoboTiG deleted the feat-ruff branch February 27, 2024 15:09
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