This makes it easier to lint your own work with `pre-commit`, but doesn't change the CI config by adding this to the pre-commit.ci skip list.
There's no way to automatically reflect the additional dependencies from the requirements file, so the flake8 plugin list needs to be a verbatim copy.
resolves#7991
The annotated type for the `raises` argument on format checkers was
Exception | tuple[Exception, ...]
when it should read
type[Exception] | tuple[type[Exception], ...]
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
schema_path, relative_schema_path, and absolute_schema_path are all
(related) attributes of `jsonschema` errors which contain `str | int`
but were accidentally annotated as containing `str`. Fix them for
accuracy.
The goal of this change is to fix the behavior of
`dataclasses.Field`. Several attributes of a `Field` may have a value
of `MISSING` (a sentinel value). As a result, attributes of Field may
be checked against `MISSING` as in
[f for f in fields(obj) if f.default is MISSING]
`default`, `default_factory`, and `kw_only` are the attributes
which may have a value of `MISSING`.
This workaround of defining `_MISSING_TYPE` as an enum, and `MISSING`
as its only member, allows `... | Literal[_MISSING_TYPE.MISSING]` to
be used in type annotations for these attributes. This is very
slightly inaccurate -- primarily in that `_MISSING_TYPE` isn't really
an enum -- but this allows for use in `Literal`.
After PEP 661 (Sentinel Values), there may be a more accurate way of
writing this, but for now this works.
This adjustment is only applied to the attributes of Field, not the
arguments to functions and methods.