-
-
Notifications
You must be signed in to change notification settings - Fork 454
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
Add a lot of runtime defaults to stubs with stubdefaulter
#2327
Conversation
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.
This looks great. 👍
Not going to go through all of it but instead assume that stubdefaulter
behaves properly. We can improve any inconsistencies/incorrect stuff over time.
One question; can we add stubdefaulter
to CI to keep defaults populated for new changes?
|
Sounds great! I suppose one way is to check git for changes after running the command. Just want to drop off a run: |
set -e
<install deps>
git add -A
<run command>
if [ -n "$(git status --porcelain -- <path>)" ]; then
echo "::error::Build result differs. Run '<run command>' then commit and push any changes"
git status --porcelain -- <path>
exit 1
fi Note: replace |
We have a huge list of fixed problems in
|
We want to integrate `stubdefaulter` to `django-stubs`: typeddjango/django-stubs#2327 Later we also want to add `stubdefaulter` to our CI, so it can check that no missing defaults are added. `--check` would help us to fail the CI. We would use both `--exit-zero` and `--check`, because there would be errors when importing django modules, we can't fix it from our side. So, we need them both to work correctly. Errors will be ignored with `--exit-zero` while `--check` will return `2` if there are any new changes.
@flaeppe I have a better idea :) |
Yeah that's even better |
We want to integrate `stubdefaulter` to `django-stubs`: typeddjango/django-stubs#2327 Later we also want to add `stubdefaulter` to our CI, so it can check that no missing defaults are added. `--check` would help us to fail the CI. We would use both `--exit-zero` and `--check`, because there would be errors when importing django modules, we can't fix it from our side. So, we need them both to work correctly. Errors will be ignored with `--exit-zero` while `--check` will return `2` if there are any new changes.
Very nice, thank you @sobolevn . |
You can do the same with: