1

pylint has a weird convention that I am trying to wrap my head around. I have the following tuple:

translations = TranslatedFields(
    first_name=models.CharField(max_length=255),
    last_name=models.CharField(max_length=255),
    discipline=models.CharField(max_length=100, blank=True, null=True)
)

My pylint config is the following for spaces and indentation:

indent-string='\t'
indent-after-paren=1

This gives me C0330 Wrong hanging indentation (add 7 spaces). Adding 7 spaces looks like the following:

translations = TranslatedFields(
                               first_name=models.CharField(max_length=255),
                               last_name=models.CharField(max_length=255),
                               discipline=models.CharField(max_length=100, blank=True, null=True)
                               )

What is the reasoning behind this convention? I am using Django + Django Parler and this is the only way to write these model attributes.

Is there a way to "hack" it or should I just disable this warning?

Gasim
  • 7,615
  • 14
  • 64
  • 131
  • Are you using VS Code maybe? I've had the same issues with Pylint there. I used [this](http://stackoverflow.com/questions/4341746/how-do-i-disable-a-pylint-warning) guide to suppress the warning. It is quite annoying. – mutantkeyboard Dec 01 '16 at 09:50
  • I disabled it too. I am going to look for a new editor. Atom has become quiet annoying... – Gasim Dec 03 '16 at 09:22
  • I don't know how much Python stuff do you do, but I found a PyCharm to be quite nice (if you prefer IDE), or Komodo Edit (which I found a nice editor). And if you want to be hardcore -> VIM all the way :) – mutantkeyboard Dec 03 '16 at 09:44

0 Answers0