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

Remove unused Any instances from TYPE_CHECKING blocks #2878

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

correctmost
Copy link
Contributor

PR Description:

This will make it easier to start removing more Any instances from the codebase.

Some of the regressions in 3.0.0 are not being caught by mypy because of the prevalence of Any in the code.

This will make it easier to start removing more Any instances from
the codebase.
@correctmost correctmost requested a review from Torxed as a code owner November 19, 2024 00:41
@@ -85,10 +85,17 @@ warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true

[[tool.mypy.overrides]]
module = "archinstall.default_profiles.applications.*"
disallow_any_explicit = true
Copy link
Collaborator

Choose a reason for hiding this comment

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

@correctmost will this prevent any future use of the _: Any?
We're using that for translations, so it's likely we'll need it again

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That setting will cause mypy to warn about the use of Any in that directory, so we'll have to use something like this instead:

_: Callable[[str], DeferredTranslation]

I plan on changing the remaining _ declarations to use Callable instead of Any, but I won't be able to do that until the weekend.

Copy link
Member

Choose a reason for hiding this comment

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

Great work overall with these quality improvements, it's understated how much we appreciated it I think!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you--and thanks for being receptive to the changes, too :)

@svartkanin svartkanin merged commit f3f7700 into archlinux:master Nov 19, 2024
8 checks passed
@correctmost correctmost deleted the cm/remove-unused-any branch November 19, 2024 07:32
castillofrancodamian pushed a commit to castillofrancodamian/archinstall that referenced this pull request Dec 21, 2024
This will make it easier to start removing more Any instances from
the codebase.
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.

3 participants