Skip to content
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

Closed
atodorov opened this issue Feb 17, 2020 · 0 comments · Fixed by #1744
Closed

new linter: All forms must inherit from ModelForm #1384

atodorov opened this issue Feb 17, 2020 · 0 comments · Fixed by #1744
Labels
refactoring € 50 bounty See bounty-program milestone

Comments

@atodorov
Copy link
Member

atodorov commented Feb 17, 2020

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:

  • new checker class under kiwi_lint/ which implements the necessary pylint machinery
  • Can be relatively simple checker. It should be sufficient to raise a warning when a function call contains a parameter with the name label. If this is too generic we can refine it later
  • All code review passed & PR merged

Here's me explaining how to write pylint plugins:

This issue is part of Kiwi TCMS open source bounty program. For more information see the link(s) in bounty-program milestone

@atodorov atodorov added the € 50 bounty See bounty-program milestone label Apr 30, 2020
@atodorov atodorov added this to the bounty-program milestone Apr 30, 2020
brymut added a commit to brymut/Kiwi that referenced this issue Jun 17, 2020
brymut added a commit to brymut/Kiwi that referenced this issue Jun 18, 2020
brymut added a commit to brymut/Kiwi that referenced this issue Jun 19, 2020
atodorov pushed a commit that referenced this issue Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring € 50 bounty See bounty-program milestone
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant