PEP-8 игнорирует максимальную длину строки - PullRequest
0 голосов
/ 03 апреля 2019

Я использую PEP8 в моем превосходном редакторе и имею следующие настройки:

{
    // autoformat code on save ?
    "autoformat_on_save": true,

    // enable possibly unsafe changes (E226, E24, W6)
    // aggressive level, 0 to disable:
    "aggressive": 0,

    // list codes for fixes; used by --ignore and --select
    "list-fixes": false,

    // do not fix these errors / warnings (e.g. [ "E501" , "E4" , "W"])
    "ignore": [],

    // select errors / warnings (e.g. ["E4", "W"])
    "select": [],

    // Maximum line length
    "max-line-length": 79
}

, и мой код выглядит так:

class MyTests(Tests):
    owner =...
    user = ...

    def create_my_cars(self, k):
        for i in range(k):
            p = MyCars.objects.create(license_plate="1234",color="blue",brand="Toyota", currentLocation="Somehwere in somewhere", owner=owner, user=user)

Теперь, когда я сохраняю свой файл, PEP8 ломаетсяэто в это:

p = MyCars.objects.create(license_plate="1234",color="blue", brand="Toyota", 
                          currentLocation="Somehwere in somewhere", owner=owner, user=user)

Но последние две строки все еще длиннее, чем max-line-length (79)?

...