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: do not use db_column in model fields #736

Closed
atodorov opened this issue Jan 23, 2019 · 1 comment · Fixed by #1887
Closed

new linter: do not use db_column in model fields #736

atodorov opened this issue Jan 23, 2019 · 1 comment · Fixed by #1887
Labels
€ 50 bounty See bounty-program milestone

Comments

@atodorov
Copy link
Member

atodorov commented Jan 23, 2019

db_column argument in model field definitions is a legacy leftover and in many cases the column name in the DB is a bit different from the model field name. All of this has been fixed but it took lots of effort to do so.

Kiwi TCMS needs a custom kiwi_lint/ checker which will discover all of these issues (if we forgot to fix some) and prevent them from happening again.

Definition of Done:

  • new checker class under kiwi_lint/ which implements the necessary pylint machinery
  • Can be relatively simple checker b/c the db_column parameter name is rather unique and we probably don't use it for anything not related to declaring Django models. It should be sufficient to raise a warning when a function call contains a parameter with the name db_column.
  • 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 added a commit that referenced this issue Jan 20, 2020
for fields which are not AutoField
atodorov added a commit that referenced this issue Jan 20, 2020
for fields which are not AutoField
atodorov added a commit that referenced this issue Jan 21, 2020
for fields which are not AutoField
atodorov added a commit that referenced this issue Jan 28, 2020
for fields which are not AutoField
atodorov added a commit that referenced this issue Feb 5, 2020
for fields which are not AutoField
atodorov added a commit that referenced this issue Feb 6, 2020
for fields which are not AutoField
atodorov added a commit that referenced this issue Feb 7, 2020
for fields which are not AutoField
atodorov added a commit that referenced this issue Feb 10, 2020
for fields which are not AutoField
@atodorov atodorov added € 50 bounty See bounty-program milestone and removed PyConBalkan help wanted labels 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 Sep 1, 2020
…b_column argument in model field definition.
brymut added a commit to brymut/Kiwi that referenced this issue Sep 2, 2020
…b_column argument in model field definition.
brymut added a commit to brymut/Kiwi that referenced this issue Sep 2, 2020
…b_column argument in model field definition.
atodorov pushed a commit that referenced this issue Sep 2, 2020
@brymut
Copy link
Contributor

brymut commented Sep 2, 2020

@atodorov submitted new expense on https://opencollective.com/kiwitcms/expenses/24577

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
€ 50 bounty See bounty-program milestone
Projects
None yet
2 participants