-
Notifications
You must be signed in to change notification settings - Fork 3
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
#8: Enable flake8 annotations. #119
Conversation
There are still a couple
Until those are resolved, i'll leave this as a draft. |
This makes me think we need to update the github action to run mypy checks against the tests as well. |
.pre-commit-config.yaml
Outdated
@@ -2,13 +2,13 @@ files: '(screenpy|tests)/.*' | |||
fail_fast: false | |||
repos: | |||
- repo: https://github.com/psf/black | |||
rev: 23.10.1 | |||
rev: 23.11.0 | |||
hooks: | |||
- id: black | |||
language_version: python3.11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It occurs to me that we have the [tool.black] target-version = ['py312']
but pre-commit only uses 3.11.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated!
@@ -106,11 +103,8 @@ dev_all = [ | |||
"autodoc-pydantic", | |||
"black", | |||
"coverage", | |||
"flake8", | |||
"isort", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are removing isort, the makefile should get updated as well. It's not required for this PR, but if you can that'd be good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, updated!
@@ -31,7 +31,8 @@ def perform_as(self, _: Actor) -> None: | |||
"""Direct the Narrator to attach a file.""" | |||
the_narrator.attaches_a_file(self.filepath, **self.attach_kwargs) | |||
|
|||
def __init__(self, filepath: str, **kwargs: Any) -> None: | |||
# ANN401 ignored here to allow for new adapters to use any kwargs. | |||
def __init__(self, filepath: str, **kwargs: Any) -> None: # noqa: ANN401 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we can use object
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure i fully understand when it's best to use object
over Any
, but all the times i've tried have ended in disaster.
I'd like to release now, so i'm gonna use my privileges @bandophahita. If you have any concerns from this PR, let's address them in the next one! |
Well we saved the best for last. This PR enables
flake8-annotations
and adds the mypy configdisallow-untyped-defs
to thetests
directory. Phew!This PR also removes the
isort
,pylint
, andflake8
tools from the dev dependencies list, since we don't use them in linting anymore.