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

[chore] Enable ruff rules UP006 and UP007 to improve type hints. #2830

Merged
merged 4 commits into from
Jul 12, 2024

Conversation

fpgmaas
Copy link
Contributor

@fpgmaas fpgmaas commented Jul 10, 2024

This PR proposes to enable the following rules in ruff:

This implements changes as proposed by PEP585 and PEP604. For example, this changes

from typing import List

def foo(
        documents: List[str],
        top_k: Optional[int] = None,
        ...
)

to

def foo(
        documents: list[str],
        top_k: int | None = None,
        ...
)

Steps to create this PR were simply updating the pyproject.toml and then running ruff check --unsafe-fixes.

@fpgmaas fpgmaas changed the title [chore] Enable ruff rules UP006 and UP007 to improve type hints. [chore] Enable ruff rules UP006 and UP007 to improve type hints. Jul 10, 2024
fpgmaas added 4 commits July 11, 2024 08:49
improve ci/cd

improve ci/cd

improve ci/cd

fix isort

try

fix
@fpgmaas fpgmaas force-pushed the chore/type-hints branch from 9068400 to 7222c96 Compare July 11, 2024 06:50
@fpgmaas fpgmaas changed the title [chore] Enable ruff rules UP006 and UP007 to improve type hints. [chore] Enable ruff rules UP006 and UP007 to improve type hints. Jul 11, 2024
@tomaarsen tomaarsen merged commit 65728ed into UKPLab:master Jul 12, 2024
11 checks passed
@tomaarsen
Copy link
Collaborator

Thank you! I think this'll be quite useful. Would you be able to resolve the conflicts in #2834?

  • Tom Aarsen

@fpgmaas fpgmaas deleted the chore/type-hints branch July 12, 2024 08:05
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