-
-
Notifications
You must be signed in to change notification settings - Fork 299
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
new linter: All forms must inherit from ModelForm #1384
Labels
Milestone
Comments
atodorov
added a commit
that referenced
this issue
Apr 11, 2020
atodorov
added a commit
that referenced
this issue
Apr 11, 2020
atodorov
added a commit
that referenced
this issue
Apr 11, 2020
atodorov
added a commit
that referenced
this issue
Apr 12, 2020
atodorov
added a commit
that referenced
this issue
Apr 12, 2020
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jun 17, 2020
…s inherit from ModelForm.
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jun 18, 2020
…s inherit from ModelForm.
brymut
added a commit
to brymut/Kiwi
that referenced
this issue
Jun 19, 2020
…s inherit from ModelForm.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In general almost all forms in Kiwi TCMS must inherit from
ModelForm
. This will have the benefit of simplifying the application and clean up some duplicate code. It will also help discover functions/views which allow sending fields that are not part of the model itself (there was such a case with TestCase.update API method).Kiwi TCMS needs a custom kiwi_lint/ checker which will discover all form classes which do not inherit from ModelForm and warn about them.
There will be a second bounty for fixing the offending forms b/c there would be quite a few I expect.
Definition of Done:
kiwi_lint/
which implements the necessary pylint machinerylabel
. If this is too generic we can refine it laterHere's me explaining how to write pylint plugins:
node_is_subclass
from pylint-django (which we use anyway) https://github.com/PyCQA/pylint-django/blob/master/pylint_django/checkers/forms.pyThis issue is part of Kiwi TCMS open source bounty program. For more information see the link(s) in bounty-program milestone
The text was updated successfully, but these errors were encountered: