-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Prefer InputRequired
over DataRequired
on form validation
#13696
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
Conversation
Naive global find/replace fails a bunch of tests. Re-running test suite with actual verbose output to see how much the failures share in common. |
For
This makes sense to me. Going through the test errors to move the error strings to the construction-time failures which are now thrown first. |
Signed-off-by: Jack Leightcap <[email protected]>
The addition of the
Because of the addition |
One last error exists, having to do with type coercion of a
|
Signed-off-by: William Woodruff <[email protected]>
Not all packages have type hints. There's an open PR on Typeshed for WebOb - so our convention has been to add an excluded entry to |
There's no current tracking issue for supporting type hints in WebOb. Signed-off-by: William Woodruff <[email protected]>
@miketheman Guessing you might know this 🙂 -- do you happen to know if there's a way to forbid |
Signed-off-by: William Woodruff <[email protected]>
We currently use Flake8 for linting, so I could imagine a Flake8 Local Plugin that disallows DataRequired. https://flake8.pycqa.org/en/latest/user/configuration.html#using-local-plugins |
Looks like https://pypi.org/project/flake8-tidy-imports/ might be a good fit as well for that! I think I'll punt on both of those for this PR, though 🙂 |
Signed-off-by: William Woodruff <[email protected]>
Nice work @jleightcap! CC @di this should be ready for review now. |
…pypi#13696)" This reverts commit 95f89b3.
…3696) * DataRequired -> InputRequired Signed-off-by: Jack Leightcap <[email protected]> * `make translations` Signed-off-by: William Woodruff <[email protected]> * pyproject: exclude webob.* from mypy There's no current tracking issue for supporting type hints in WebOb. Signed-off-by: William Woodruff <[email protected]> * pyproject: tracking issue Signed-off-by: William Woodruff <[email protected]> * tests: mash a type into place Signed-off-by: William Woodruff <[email protected]> --------- Signed-off-by: Jack Leightcap <[email protected]> Signed-off-by: William Woodruff <[email protected]> Co-authored-by: William Woodruff <[email protected]>
…3696) * DataRequired -> InputRequired Signed-off-by: Jack Leightcap <[email protected]> * `make translations` Signed-off-by: William Woodruff <[email protected]> * pyproject: exclude webob.* from mypy There's no current tracking issue for supporting type hints in WebOb. Signed-off-by: William Woodruff <[email protected]> * pyproject: tracking issue Signed-off-by: William Woodruff <[email protected]> * tests: mash a type into place Signed-off-by: William Woodruff <[email protected]> --------- Signed-off-by: Jack Leightcap <[email protected]> Signed-off-by: William Woodruff <[email protected]> Co-authored-by: William Woodruff <[email protected]>
…3696) * DataRequired -> InputRequired Signed-off-by: Jack Leightcap <[email protected]> * `make translations` Signed-off-by: William Woodruff <[email protected]> * pyproject: exclude webob.* from mypy There's no current tracking issue for supporting type hints in WebOb. Signed-off-by: William Woodruff <[email protected]> * pyproject: tracking issue Signed-off-by: William Woodruff <[email protected]> * tests: mash a type into place Signed-off-by: William Woodruff <[email protected]> --------- Signed-off-by: Jack Leightcap <[email protected]> Signed-off-by: William Woodruff <[email protected]> Co-authored-by: William Woodruff <[email protected]>
* Prefer `InputRequired` over `DataRequired` on form validation (#13696) * DataRequired -> InputRequired Signed-off-by: Jack Leightcap <[email protected]> * `make translations` Signed-off-by: William Woodruff <[email protected]> * pyproject: exclude webob.* from mypy There's no current tracking issue for supporting type hints in WebOb. Signed-off-by: William Woodruff <[email protected]> * pyproject: tracking issue Signed-off-by: William Woodruff <[email protected]> * tests: mash a type into place Signed-off-by: William Woodruff <[email protected]> --------- Signed-off-by: Jack Leightcap <[email protected]> Signed-off-by: William Woodruff <[email protected]> Co-authored-by: William Woodruff <[email protected]> * Validate views Forms Signed-off-by: Jack Leightcap <[email protected]> Validated CreateMacaroonForm Signed-off-by: Jack Leightcap <[email protected]> * forms: manage.views.teams Signed-off-by: Jack Leightcap <[email protected]> * forms: Manage Signed-off-by: Jack Leightcap <[email protected]> * forms: OIDC Signed-off-by: Jack Leightcap <[email protected]> * forms: base Signed-off-by: Jack Leightcap <[email protected]> * forms: Accounts Signed-off-by: Jack Leightcap <[email protected]> * forms: admin.views.users Signed-off-by: Jack Leightcap <[email protected]> * forms: admin.views.sponsors Signed-off-by: Jack Leightcap <[email protected]> * forms: admin.views.banners Signed-off-by: Jack Leightcap <[email protected]> * forms: manage.views.organizations Signed-off-by: Jack Leightcap <[email protected]> * forms: functional changes Signed-off-by: Jack Leightcap <[email protected]> * tests, warehouse: fix password reset form Signed-off-by: William Woodruff <[email protected]> * locale: `make translations` Signed-off-by: William Woodruff <[email protected]> * tests: remove deleted form tests Signed-off-by: William Woodruff <[email protected]> --------- Signed-off-by: Jack Leightcap <[email protected]> Signed-off-by: William Woodruff <[email protected]> Co-authored-by: William Woodruff <[email protected]>
WIP
Resolves #13695