Fix multiple lint issues in state.py #261
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a second try for #251.
This is not changing the
isfile, so the issue withNo such file or directory: 'hilo_state.yaml'should not happen again.I also found an issue when doing
from __future__ import annotationsthat would break the dict detection in_get_defaults. I left a bunch of comments explaining what the code is doing, since it's a bit obscure.D100 Missing docstring in public module
UP035
typing.Typeis deprecated, usetypeinsteadD101 Missing docstring in public class
FA100 Add
from __future__ import annotationsto simplifytyping.OptionalN807 Function name should not start and end with
__UP006 Use
typeinstead ofTypefor type annotationD400 First line should end with a period
D401 First line of docstring should be in imperative mood: "Generates a default dict based on typed dict"
D415 First line should end with a period, question mark, or exclamation point
PGH003 Use specific rule codes when ignoring type issues
D205 1 blank line required between summary line and description
FA100 Add
from __future__ import annotationsto simplifytyping.UnionNot done in this PR:
PTH113os.path.isfile()should be replaced byPath.is_file()This is not really needed, I feel it would make the code harder to read and it would make performance a tiny fraction worse too, so let's not do that since we don't need anything else from the
Pathobject.